Skip to content
Snippets Groups Projects
Commit ed45bcdd authored by Kali Kaneko's avatar Kali Kaneko
Browse files

catch aboutToQuit

parent 25a905ed
Branches master
Tags 0.20.4
No related merge requests found
...@@ -77,9 +77,6 @@ Page { ...@@ -77,9 +77,6 @@ Page {
text: qsTr("Quit") text: qsTr("Quit")
icon: "../resources/quit.svg" icon: "../resources/quit.svg"
triggered: function() { triggered: function() {
if (ctx.status == "on") {
backend.switchOff()
}
Qt.callLater(backend.quit) Qt.callLater(backend.quit)
} }
} }
......
...@@ -56,9 +56,6 @@ Labs.SystemTrayIcon { ...@@ -56,9 +56,6 @@ Labs.SystemTrayIcon {
//: Part of the systray menu; quits the application //: Part of the systray menu; quits the application
text: qsTr("Quit") text: qsTr("Quit")
onTriggered: { onTriggered: {
if (ctx.status == "on") {
backend.switchOff()
}
backend.quit() backend.quit()
} }
} }
......
...@@ -48,7 +48,6 @@ QString getAppName(QJsonValue info, QString provider) { ...@@ -48,7 +48,6 @@ QString getAppName(QJsonValue info, QString provider) {
auto handler = [](int sig) -> void { auto handler = [](int sig) -> void {
printf("\nCatched signal(%d): quitting\n", sig); printf("\nCatched signal(%d): quitting\n", sig);
Quit();
QApplication::quit(); QApplication::quit();
}; };
...@@ -82,6 +81,11 @@ int main(int argc, char **argv) { ...@@ -82,6 +81,11 @@ int main(int argc, char **argv) {
app.setQuitOnLastWindowClosed(false); app.setQuitOnLastWindowClosed(false);
app.setAttribute(Qt::AA_UseHighDpiPixmaps); app.setAttribute(Qt::AA_UseHighDpiPixmaps);
QObject::connect(&app, &QApplication::aboutToQuit, []() {
qDebug() << ">>> Quitting, bye!";
Quit();
});
#ifdef OS_WIN #ifdef OS_WIN
signal(SIGINT, handler); signal(SIGINT, handler);
signal(SIGTERM, handler); signal(SIGTERM, handler);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment