X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcommon%2Fquassel.h;h=b42ee47d38503907ba89d9404f2346fcc8878408;hp=4b9c5a9147ea6c77b182ae1e834aea9e142ac604;hb=7aa691713f4185fe142f54e14d6b623ee706f77a;hpb=8c16bc6817aac177791686ac1a5ad8ee2d93410c diff --git a/src/common/quassel.h b/src/common/quassel.h index 4b9c5a91..b42ee47d 100644 --- a/src/common/quassel.h +++ b/src/common/quassel.h @@ -58,6 +58,25 @@ public: QString organizationDomain; }; + //! A list of features that are optional in core and/or client, but need runtime checking + /** Some features require an uptodate counterpart, but don't justify a protocol break. + * This is what we use this enum for. Add such features to it and check at runtime on the other + * side for their existence. + * + * This list should be cleaned up after every protocol break, as we can assume them to be present then. + */ + enum Feature { + SynchronizedMarkerLine = 0x0001, + + NumFeatures = 0x0001 + }; + Q_DECLARE_FLAGS(Features, Feature); + + //! The features the current version of Quassel supports (\sa Feature) + /** \return An ORed list of all enum values in Feature + */ + static Features features(); + virtual ~Quassel(); static void setupBuildInfo(const QString &generated); @@ -111,6 +130,7 @@ protected: inline void setRunMode(RunMode mode); inline void setDataDirPaths(const QStringList &paths); QStringList findDataDirPaths() const; + inline void disableCrashhandler(); private: void registerMetaTypes(); @@ -123,6 +143,7 @@ private: static AbstractCliParser *_cliParser; static RunMode _runMode; static bool _initialized; + static bool _handleCrashes; static QString _coreDumpFileName; static QString _configDirPath; @@ -130,10 +151,13 @@ private: static QString _translationDirPath; }; +Q_DECLARE_OPERATORS_FOR_FLAGS(Quassel::Features); + const Quassel::BuildInfo & Quassel::buildInfo() { return _buildInfo; } Quassel::RunMode Quassel::runMode() { return _runMode; } void Quassel::setRunMode(Quassel::RunMode mode) { _runMode = mode; } void Quassel::setDataDirPaths(const QStringList &paths) { _dataDirPaths = paths; } +void Quassel::disableCrashhandler() { _handleCrashes = false; } void Quassel::setCliParser(AbstractCliParser *parser) { _cliParser = parser; } AbstractCliParser *Quassel::cliParser() { return _cliParser; }