Browse Source

refactor: remove Nexus::quit() and replace with qApp->quit()

They are doing the same.
reviewable/pr5418/r2
sudden6 7 years ago
parent
commit
6097c3f94f
No known key found for this signature in database
GPG Key ID: 279509B499E032B9
  1. 10
      src/nexus.cpp
  2. 1
      src/nexus.h
  3. 4
      src/widget/widget.cpp

10
src/nexus.cpp

@ -163,7 +163,7 @@ void Nexus::showLogin() @@ -163,7 +163,7 @@ void Nexus::showLogin()
Settings::getInstance().setCurrentProfile(profile->getName());
showMainGUI();
} else {
quit();
qApp->quit();
}
}
@ -225,14 +225,6 @@ void Nexus::showMainGUI() @@ -225,14 +225,6 @@ void Nexus::showMainGUI()
GUI::setEnabled(true);
}
/**
* @brief Calls QApplication::quit(), and causes Nexus::isRunning() to return false
*/
void Nexus::quit()
{
qApp->quit();
}
/**
* @brief Returns the singleton instance.
*/

1
src/nexus.h

@ -42,7 +42,6 @@ class Nexus : public QObject @@ -42,7 +42,6 @@ class Nexus : public QObject
public:
void start();
void showMainGUI();
void quit();
static Nexus& getInstance();
static void destroyInstance();

4
src/widget/widget.cpp

@ -589,7 +589,7 @@ void Widget::closeEvent(QCloseEvent* event) @@ -589,7 +589,7 @@ void Widget::closeEvent(QCloseEvent* event)
saveWindowGeometry();
saveSplitterGeometry();
QWidget::closeEvent(event);
Nexus::getInstance().quit();
qApp->quit();
}
}
@ -638,7 +638,7 @@ void Widget::onFailedToStartCore() @@ -638,7 +638,7 @@ void Widget::onFailedToStartCore()
"toxcore failed to start, the application will terminate after you close this message."));
critical.setIcon(QMessageBox::Critical);
critical.exec();
Nexus::getInstance().quit();
qApp->exit(EXIT_FAILURE);
}
void Widget::onBadProxyCore()

Loading…
Cancel
Save