X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcommon%2Fquassel.h;h=157386a8e47118971fd0f193c1418846f40088f1;hp=17e252c13d3cf28050d4eb77f73657156435c172;hb=1f2784bfa1c1ce90defa32f13c78afd72c227bfd;hpb=493043890c74e4679bb3fdaf512a0e1e52c426d3 diff --git a/src/common/quassel.h b/src/common/quassel.h index 17e252c1..157386a8 100644 --- a/src/common/quassel.h +++ b/src/common/quassel.h @@ -198,10 +198,26 @@ public: using QuitHandler = std::function; + /** + * Registers a handler that is called when the application is supposed to quit. + * + * @note If multiple handlers are registered, they are processed in order of registration. + * @note If any handler is registered, quit() will not call QCoreApplication::quit(). It relies + * on one of the handlers doing so, instead. + * @param quitHandler Handler to register + */ static void registerQuitHandler(QuitHandler quitHandler); const QString &coreDumpFileName(); +public slots: + /** + * Requests to quit the application. + * + * Calls any registered quit handlers. If no handlers are registered, calls QCoreApplication::quit(). + */ + void quit(); + signals: void messageLogged(const QDateTime &timeStamp, const QString &msg); @@ -232,13 +248,6 @@ private: */ bool reloadConfig(); - /** - * Requests to quit the application. - * - * Calls any registered quit handlers. If no handlers are registered, calls QCoreApplication::quit(). - */ - void quit(); - void logBacktrace(const QString &filename); static void handleSignal(int signal); @@ -248,6 +257,7 @@ private: RunMode _runMode; bool _initialized{false}; bool _handleCrashes{true}; + bool _quitting{false}; QString _coreDumpFileName; QString _configDirPath;