diff options
author | Hannah von Reth <hannah.vonreth@owncloud.com> | 2021-09-13 13:45:47 +0300 |
---|---|---|
committer | Hannah von Reth <vonreth@kde.org> | 2021-09-14 11:04:22 +0300 |
commit | 92ec18ce1d964ddcb6e68eac84a06bc8027785bc (patch) | |
tree | e886ddd912af9fa72579f2b7aae594388b890daa /src/common | |
parent | 4ed5b5923b355a8c5af9dc4fd73d418dbf830793 (diff) |
Add SyncStatus to the tables
Issue: #9000
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/utility.h | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/src/common/utility.h b/src/common/utility.h index f4a10271c..3d2e77bd7 100644 --- a/src/common/utility.h +++ b/src/common/utility.h @@ -21,12 +21,13 @@ #define UTILITY_H #include "ocsynclib.h" -#include <QString> #include <QByteArray> #include <QDateTime> #include <QElapsedTimer> #include <QLoggingCategory> #include <QMap> +#include <QMetaEnum> +#include <QString> #include <QUrl> #include <QUrlQuery> #include <functional> @@ -42,12 +43,13 @@ namespace OCC { class SyncJournal; -Q_DECLARE_LOGGING_CATEGORY(lcUtility) +OCSYNC_EXPORT Q_DECLARE_LOGGING_CATEGORY(lcUtility) -/** \addtogroup libsync + /** \addtogroup libsync * @{ */ -namespace Utility { + namespace Utility +{ OCSYNC_EXPORT void sleep(int sec); OCSYNC_EXPORT void usleep(int usec); OCSYNC_EXPORT QString formatFingerprint(const QByteArray &, bool colonSeparated = true); @@ -265,6 +267,18 @@ namespace Utility { }; #endif + + template <class E> + QString enumName(E value) + { + return QMetaEnum::fromType<E>().valueToKeys(value); + } + template <class E = void> + QString enumDisplayName(E) + { + static_assert(std::is_same<E, void>::value, "Not implemented"); + Q_UNREACHABLE(); + } } /** @} */ // \addtogroup |