diff --git a/src/gui/src/DeskflowApplication.cpp b/src/gui/src/DeskflowApplication.cpp deleted file mode 100644 index 4a272e06a..000000000 --- a/src/gui/src/DeskflowApplication.cpp +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Deskflow -- mouse and keyboard sharing utility - * Copyright (C) 2012 Symless Ltd. - * Copyright (C) 2008 Volker Lanz (vl@fidra.de) - * - * This package is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * found in the file LICENSE that should have accompanied this file. - * - * This package is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "DeskflowApplication.h" - -#include "MainWindow.h" - -DeskflowApplication::DeskflowApplication(int &argc, char **argv) : QApplication(argc, argv) -{ - - if (qEnvironmentVariable("XDG_CURRENT_DESKTOP") != QLatin1String("KDE")) { - // causes dark mode to be used on some OS (e.g. Windows) - setStyle("fusion"); - } -} diff --git a/src/gui/src/DeskflowApplication.h b/src/gui/src/DeskflowApplication.h deleted file mode 100644 index caa89f87a..000000000 --- a/src/gui/src/DeskflowApplication.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Deskflow -- mouse and keyboard sharing utility - * Copyright (C) 2012 Symless Ltd. - * Copyright (C) 2008 Volker Lanz (vl@fidra.de) - * - * This package is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * found in the file LICENSE that should have accompanied this file. - * - * This package is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#pragma once - -#include - -class QSessionManager; - -class DeskflowApplication : public QApplication -{ -public: - DeskflowApplication(int &argc, char **argv); - ~DeskflowApplication() override = default; -}; diff --git a/src/gui/src/main.cpp b/src/gui/src/main.cpp index 30113434e..a34711ad8 100644 --- a/src/gui/src/main.cpp +++ b/src/gui/src/main.cpp @@ -16,7 +16,6 @@ * along with this program. If not, see . */ -#include "DeskflowApplication.h" #include "MainWindow.h" #include "SetupWizard.h" #include "common/constants.h" @@ -83,7 +82,14 @@ int main(int argc, char *argv[]) // used as a prefix for settings paths, and must not be a url. QCoreApplication::setOrganizationDomain(kOrgDomain); - DeskflowApplication app(argc, argv); + QApplication app(argc, argv); + +#if !defined(Q_OS_MAC) + // causes dark mode to be used on some DE's + if (qEnvironmentVariable("XDG_CURRENT_DESKTOP") != QLatin1String("KDE")) { + qApp->setStyle("fusion"); + } +#endif qInstallMessageHandler(deskflow::gui::messages::messageHandler); QString version = QString::fromStdString(deskflow::version()); @@ -136,16 +142,13 @@ int main(int argc, char *argv[]) } MainWindow mainWindow(configScopes, appConfig); - - QObject::connect(&app, &DeskflowApplication::aboutToQuit, &mainWindow, &MainWindow::onAppAboutToQuit); - mainWindow.open(); #ifdef DESKFLOW_GUI_HOOK_START DESKFLOW_GUI_HOOK_START #endif - return DeskflowApplication::exec(); + return qApp->exec(); } #if defined(Q_OS_MAC)