From bdb87ac6b3640475dd0b64593a083311faf158a3 Mon Sep 17 00:00:00 2001 From: Martin Rotter Date: Thu, 14 Sep 2017 09:11:25 +0200 Subject: [PATCH] Format method, fix name. --- rssguard.pro | 4 +-- src/miscellaneous/application.cpp | 51 +++++++++++++++---------------- 2 files changed, 26 insertions(+), 29 deletions(-) diff --git a/rssguard.pro b/rssguard.pro index 286efe06e..2776fe019 100755 --- a/rssguard.pro +++ b/rssguard.pro @@ -631,11 +631,11 @@ QMAKE_EXTRA_COMPILERS += lrelease win32 { seven_zip.target = 7zip seven_zip.depends = install - seven_zip.commands = $$shell_path($$shell_quote($$PWD/resources/scripts/7za/7za.exe)) a -t7z $$TARGET-$$APP_VERSION-$$APP_REVISION-$$APP_WIN_ARCH.7z $$shell_path($$PREFIX/*) + seven_zip.commands = $$shell_path($$shell_quote($$PWD/resources/scripts/7za/7za.exe)) a -t7z $$TARGET-$$APP_VERSION-$$APP_REVISION-$${APP_WIN_ARCH}.7z $$shell_path($$PREFIX/*) zip.target = zip zip.depends = install - zip.commands = $$shell_path($$shell_quote($$PWD/resources/scripts/7za/7za.exe)) a -tzip $$TARGET-$$APP_VERSION-$$APP_REVISION-$$APP_WIN_ARCH.zip $$shell_path($$PREFIX/*) + zip.commands = $$shell_path($$shell_quote($$PWD/resources/scripts/7za/7za.exe)) a -tzip $$TARGET-$$APP_VERSION-$$APP_REVISION-$${APP_WIN_ARCH}.zip $$shell_path($$PREFIX/*) QMAKE_EXTRA_TARGETS += seven_zip zip } diff --git a/src/miscellaneous/application.cpp b/src/miscellaneous/application.cpp index 2363ab1a9..954e90f71 100755 --- a/src/miscellaneous/application.cpp +++ b/src/miscellaneous/application.cpp @@ -357,58 +357,55 @@ void Application::onSaveState(QSessionManager& manager) { } void Application::onAboutToQuit() { - /* - eliminateFirstRun(); - eliminateFirstRun(APP_VERSION); + eliminateFirstRun(APP_VERSION); - #if defined(USE_WEBENGINE) +#if defined(USE_WEBENGINE) AdBlockManager::instance()->save(); - #endif +#endif // Make sure that we obtain close lock BEFORE even trying to quit the application. const bool locked_safely = feedUpdateLock()->tryLock(4 * CLOSE_LOCK_TIMEOUT); processEvents(); qDebug("Cleaning up resources and saving application state."); - #if defined(Q_OS_WIN) +#if defined(Q_OS_WIN) system()->removeTrolltechJunkRegistryKeys(); - #endif +#endif qApp->feedReader()->quit(); database()->saveDatabase(); if (mainForm() != nullptr) { - mainForm()->saveSize(); + mainForm()->saveSize(); } if (locked_safely) { - // Application obtained permission to close in a safe way. - qDebug("Close lock was obtained safely."); - // We locked the lock to exit peacefully, unlock it to avoid warnings. - feedUpdateLock()->unlock(); + // Application obtained permission to close in a safe way. + qDebug("Close lock was obtained safely."); + // We locked the lock to exit peacefully, unlock it to avoid warnings. + feedUpdateLock()->unlock(); } else { - // Request for write lock timed-out. This means - // that some critical action can be processed right now. - qDebug("Close lock timed-out."); + // Request for write lock timed-out. This means + // that some critical action can be processed right now. + qDebug("Close lock timed-out."); } // Now, we can check if application should just quit or restart itself. if (m_shouldRestart) { - finish(); - qDebug("Killing local peer connection to allow another instance to start."); + finish(); + qDebug("Killing local peer connection to allow another instance to start."); - // TODO: Start RSS Guard with sleep before it cross-platform way if possible. - // sleep 5 && "". - if (QProcess::startDetached(QString("\"") + QDir::toNativeSeparators(applicationFilePath()) + QString("\""))) { - qDebug("New application instance was started."); - } - else { - qWarning("New application instance was not started successfully."); - } - } - */ + // TODO: Start RSS Guard with sleep before it cross-platform way if possible. + // sleep 5 && "". + if (QProcess::startDetached(QString("\"") + QDir::toNativeSeparators(applicationFilePath()) + QString("\""))) { + qDebug("New application instance was started."); + } + else { + qWarning("New application instance was not started successfully."); + } + } } void Application::restart() {