X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fcommon%2Fquassel.h;h=2b57a31e32a956622c657b72318b9a9769ebbb0c;hb=d9e586707522241d628a90466e13722e342cc28a;hp=157386a8e47118971fd0f193c1418846f40088f1;hpb=1f2784bfa1c1ce90defa32f13c78afd72c227bfd;p=quassel.git diff --git a/src/common/quassel.h b/src/common/quassel.h index 157386a8..2b57a31e 100644 --- a/src/common/quassel.h +++ b/src/common/quassel.h @@ -21,17 +21,17 @@ #pragma once #include -#include #include +#include #include #include -#include #include +#include #include #include -#include "abstractcliparser.h" +#include "abstractsignalwatcher.h" #include "singleton.h" class QFile; @@ -114,11 +114,7 @@ public: * * This list should be cleaned up after every protocol break, as we can assume them to be present then. */ - #if QT_VERSION >= 0x050000 enum class Feature : uint32_t { - #else - enum Feature { - #endif SynchronizedMarkerLine, SaslAuthentication, SaslExternal, @@ -137,9 +133,7 @@ public: LongTime, ///< Serialize time as 64-bit values RichMessages, ///< Real Name and Avatar URL in backlog BacklogFilterType, ///< BacklogManager supports filtering backlog by MessageType -#if QT_VERSION >= 0x050500 EcdsaCertfpKeys, ///< ECDSA keys for CertFP in identities -#endif LongMessageId, ///< 64-bit IDs for messages SyncedCoreInfo, ///< CoreInfo dynamically updated using signals }; @@ -149,6 +143,8 @@ public: Quassel(); + void init(RunMode runMode); + /** * Provides access to the Logger instance. * @@ -188,7 +184,6 @@ public: static void loadTranslation(const QLocale &locale); - static void setCliParser(std::shared_ptr cliParser); static QString optionValue(const QString &option); static bool isOptionSet(const QString &option); @@ -221,22 +216,11 @@ public slots: signals: void messageLogged(const QDateTime &timeStamp, const QString &msg); -protected: - static bool init(); - - static void setRunMode(Quassel::RunMode runMode); - - static void setDataDirPaths(const QStringList &paths); - static QStringList findDataDirPaths(); - static void disableCrashHandler(); - - friend class CoreApplication; - friend class QtUiApplication; - friend class MonolithicApplication; - private: - void setupEnvironment(); void registerMetaTypes(); + void setupSignalHandling(); + void setupEnvironment(); + void setupCliParser(); /** * Requests a reload of relevant runtime configuration. @@ -250,13 +234,12 @@ private: void logBacktrace(const QString &filename); - static void handleSignal(int signal); +private slots: + void handleSignal(AbstractSignalWatcher::Action action); private: BuildInfo _buildInfo; RunMode _runMode; - bool _initialized{false}; - bool _handleCrashes{true}; bool _quitting{false}; QString _coreDumpFileName; @@ -264,9 +247,10 @@ private: QStringList _dataDirPaths; QString _translationDirPath; - std::shared_ptr _cliParser; + QCommandLineParser _cliParser; Logger *_logger; + AbstractSignalWatcher *_signalWatcher{nullptr}; std::vector _reloadHandlers; std::vector _quitHandlers;