summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkali kaneko (leap communications) <kali@leap.se>2021-12-16 16:35:01 +0100
committerkali kaneko (leap communications) <kali@leap.se>2021-12-16 16:35:01 +0100
commited45bcdd406928b93f2bfca0f293fc71a624fcfe (patch)
treee58ed853022036130aece07baf62c14d38f68ac9
parent25a905ed7775ca8ecc12de158ff74d1e7447db17 (diff)
catch aboutToQuitbug/stop-fw-osx
-rw-r--r--gui/components/MainView.qml3
-rw-r--r--gui/components/Systray.qml3
-rw-r--r--gui/main.cpp6
3 files changed, 5 insertions, 7 deletions
diff --git a/gui/components/MainView.qml b/gui/components/MainView.qml
index 25a388c..946e36f 100644
--- a/gui/components/MainView.qml
+++ b/gui/components/MainView.qml
@@ -77,9 +77,6 @@ Page {
text: qsTr("Quit")
icon: "../resources/quit.svg"
triggered: function() {
- if (ctx.status == "on") {
- backend.switchOff()
- }
Qt.callLater(backend.quit)
}
}
diff --git a/gui/components/Systray.qml b/gui/components/Systray.qml
index 51f3148..1026f01 100644
--- a/gui/components/Systray.qml
+++ b/gui/components/Systray.qml
@@ -56,9 +56,6 @@ Labs.SystemTrayIcon {
//: Part of the systray menu; quits the application
text: qsTr("Quit")
onTriggered: {
- if (ctx.status == "on") {
- backend.switchOff()
- }
backend.quit()
}
}
diff --git a/gui/main.cpp b/gui/main.cpp
index fe96caa..1cb2d0e 100644
--- a/gui/main.cpp
+++ b/gui/main.cpp
@@ -48,7 +48,6 @@ QString getAppName(QJsonValue info, QString provider) {
auto handler = [](int sig) -> void {
printf("\nCatched signal(%d): quitting\n", sig);
- Quit();
QApplication::quit();
};
@@ -82,6 +81,11 @@ int main(int argc, char **argv) {
app.setQuitOnLastWindowClosed(false);
app.setAttribute(Qt::AA_UseHighDpiPixmaps);
+ QObject::connect(&app, &QApplication::aboutToQuit, []() {
+ qDebug() << ">>> Quitting, bye!";
+ Quit();
+ });
+
#ifdef OS_WIN
signal(SIGINT, handler);
signal(SIGTERM, handler);