diff --git a/src/core/controller.cpp b/src/core/controller.cpp index 08bbd3f5..53305935 100644 --- a/src/core/controller.cpp +++ b/src/core/controller.cpp @@ -69,7 +69,6 @@ Controller::Controller() #endif { m_appLatestVersion = QStringLiteral(APP_VERSION).replace("v", ""); - qApp->setQuitOnLastWindowClosed(false); QString StyleSheet = CaptureButton::globalStyleSheet(); qApp->setStyleSheet(StyleSheet); @@ -134,11 +133,6 @@ void Controller::setCheckForUpdatesEnabled(const bool enabled) } } -QMap& Controller::requests() -{ - return m_requestMap; -} - void Controller::getLatestAvailableVersion() { // This features is required for MacOS and Windows user and for Linux users @@ -535,13 +529,6 @@ void Controller::sendTrayNotification(const QString& text, } } -void Controller::updateConfigComponents() -{ - if (m_configWindow) { - m_configWindow->updateChildren(); - } -} - void Controller::showRecentUploads() { static HistoryWidget* historyWidget = nullptr; diff --git a/src/core/controller.h b/src/core/controller.h index 08ac0c1c..ef6517aa 100644 --- a/src/core/controller.h +++ b/src/core/controller.h @@ -33,14 +33,8 @@ class Controller : public QObject public: static Controller* getInstance(); - Controller(const Controller&) = delete; - ~Controller(); - void operator=(const Controller&) = delete; - void setCheckForUpdatesEnabled(const bool enabled); - QMap& requests(); - signals: // TODO remove all parameters from captureTaken and update dependencies void captureTaken(QPixmap p, const QRect& selection); @@ -62,8 +56,6 @@ public slots: const QString& title = QStringLiteral("Flameshot Info"), const int timeout = 5000); - void updateConfigComponents(); - void showRecentUploads(); void exportCapture(QPixmap p, QRect& selection, const CaptureRequest& req); @@ -84,6 +76,7 @@ public slots: // TODO move these up private: Controller(); + ~Controller(); void getLatestAvailableVersion(); // replace QTimer::singleShot introduced in Qt 5.4 @@ -96,7 +89,6 @@ private: QString m_appLatestVersion; bool m_showCheckAppUpdateStatus; - QMap m_requestMap; QPointer m_captureWindow; QPointer m_infoWindow; QPointer m_launcherWindow; diff --git a/src/core/flameshotdaemon.cpp b/src/core/flameshotdaemon.cpp index 7099e443..ca7844cd 100644 --- a/src/core/flameshotdaemon.cpp +++ b/src/core/flameshotdaemon.cpp @@ -68,6 +68,7 @@ void FlameshotDaemon::start() { if (!m_instance) { m_instance = new FlameshotDaemon(); + qApp->setQuitOnLastWindowClosed(false); } } diff --git a/src/widgets/capture/capturewidget.cpp b/src/widgets/capture/capturewidget.cpp index 0ada39e3..6cc994ae 100644 --- a/src/widgets/capture/capturewidget.cpp +++ b/src/widgets/capture/capturewidget.cpp @@ -84,6 +84,7 @@ CaptureWidget::CaptureWidget(const CaptureRequest& req, this, &CaptureWidget::childLeave); setAttribute(Qt::WA_DeleteOnClose); + setAttribute(Qt::WA_QuitOnClose, false); m_opacity = m_config.contrastOpacity(); m_uiColor = m_config.uiColor(); m_contrastUiColor = m_config.contrastUiColor(); diff --git a/src/widgets/capturelauncher.cpp b/src/widgets/capturelauncher.cpp index 91e8ecab..3a90856a 100644 --- a/src/widgets/capturelauncher.cpp +++ b/src/widgets/capturelauncher.cpp @@ -22,6 +22,7 @@ CaptureLauncher::CaptureLauncher(QDialog* parent) : QDialog(parent) { + qApp->installEventFilter(this); // see eventFilter() setAttribute(Qt::WA_DeleteOnClose); setWindowIcon(QIcon(GlobalValues::iconPath())); m_imageLabel = new ImageLabel(this);