diff --git a/src/net/toxuri.cpp b/src/net/toxuri.cpp index 6693b9148..eaf6db516 100644 --- a/src/net/toxuri.cpp +++ b/src/net/toxuri.cpp @@ -56,18 +56,12 @@ bool handleToxURI(const QString& toxURI) Core* core = nexus.getCore(); while (!core) { - if (!nexus.isRunning()) - return false; - core = nexus.getCore(); qApp->processEvents(); QThread::msleep(10); } while (!core->isReady()) { - if (!nexus.isRunning()) - return false; - qApp->processEvents(); QThread::msleep(10); } diff --git a/src/nexus.cpp b/src/nexus.cpp index 57051e5e7..bee0dd79a 100644 --- a/src/nexus.cpp +++ b/src/nexus.cpp @@ -60,7 +60,6 @@ Nexus::Nexus(QObject* parent) : QObject(parent) , profile{nullptr} , widget{nullptr} - , running{true} {} Nexus::~Nexus() @@ -231,21 +230,9 @@ void Nexus::showMainGUI() */ void Nexus::quit() { - running = false; qApp->quit(); } -/** - * @brief Returns true until Nexus::quit is called. - * - * Any blocking processEvents() loop should check this as a return condition, - * since the application can not quit until control is returned to the event loop. - */ -bool Nexus::isRunning() -{ - return running; -} - /** * @brief Returns the singleton instance. */ diff --git a/src/nexus.h b/src/nexus.h index 9eb471910..eda7df5e9 100644 --- a/src/nexus.h +++ b/src/nexus.h @@ -43,7 +43,6 @@ public: void start(); void showMainGUI(); void quit(); - bool isRunning(); static Nexus& getInstance(); static void destroyInstance(); @@ -91,7 +90,6 @@ private: private: Profile* profile; Widget* widget; - bool running; }; #endif // NEXUS_H diff --git a/src/persistence/toxsave.cpp b/src/persistence/toxsave.cpp index f34869460..8a2e16434 100644 --- a/src/persistence/toxsave.cpp +++ b/src/persistence/toxsave.cpp @@ -18,17 +18,15 @@ */ #include "toxsave.h" -#include "src/core/core.h" -#include "src/persistence/settings.h" #include "src/widget/gui.h" #include "src/widget/tool/profileimporter.h" #include -#include bool toxSaveEventHandler(const QByteArray& eventData) { - if (!eventData.endsWith(".tox")) + if (!eventData.endsWith(".tox")) { return false; + } handleToxSave(eventData); return true; @@ -42,16 +40,6 @@ bool toxSaveEventHandler(const QByteArray& eventData) */ bool handleToxSave(const QString& path) { - Core* core = Core::getInstance(); - - while (!core) { - core = Core::getInstance(); - qApp->processEvents(); - } - - while (!core->isReady()) - qApp->processEvents(); - ProfileImporter importer(GUI::getMainWidget()); return importer.importProfile(path); }