SAMPLE build for testing.
This commit is contained in:
parent
72337653c6
commit
3671ab7b35
1 changed files with 30 additions and 23 deletions
|
@ -357,51 +357,58 @@ void Application::onSaveState(QSessionManager& manager) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Application::onAboutToQuit() {
|
void Application::onAboutToQuit() {
|
||||||
eliminateFirstRun();
|
/*
|
||||||
|
|
||||||
|
eliminateFirstRun();
|
||||||
eliminateFirstRun(APP_VERSION);
|
eliminateFirstRun(APP_VERSION);
|
||||||
#if defined(USE_WEBENGINE)
|
|
||||||
|
#if defined(USE_WEBENGINE)
|
||||||
AdBlockManager::instance()->save();
|
AdBlockManager::instance()->save();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Make sure that we obtain close lock BEFORE even trying to quit the application.
|
// Make sure that we obtain close lock BEFORE even trying to quit the application.
|
||||||
const bool locked_safely = feedUpdateLock()->tryLock(4 * CLOSE_LOCK_TIMEOUT);
|
const bool locked_safely = feedUpdateLock()->tryLock(4 * CLOSE_LOCK_TIMEOUT);
|
||||||
processEvents();
|
processEvents();
|
||||||
qDebug("Cleaning up resources and saving application state.");
|
qDebug("Cleaning up resources and saving application state.");
|
||||||
#if defined(Q_OS_WIN)
|
|
||||||
|
#if defined(Q_OS_WIN)
|
||||||
system()->removeTrolltechJunkRegistryKeys();
|
system()->removeTrolltechJunkRegistryKeys();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
qApp->feedReader()->quit();
|
qApp->feedReader()->quit();
|
||||||
database()->saveDatabase();
|
database()->saveDatabase();
|
||||||
|
|
||||||
if (mainForm() != nullptr) {
|
if (mainForm() != nullptr) {
|
||||||
mainForm()->saveSize();
|
mainForm()->saveSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (locked_safely) {
|
if (locked_safely) {
|
||||||
// Application obtained permission to close in a safe way.
|
// Application obtained permission to close in a safe way.
|
||||||
qDebug("Close lock was obtained safely.");
|
qDebug("Close lock was obtained safely.");
|
||||||
// We locked the lock to exit peacefully, unlock it to avoid warnings.
|
// We locked the lock to exit peacefully, unlock it to avoid warnings.
|
||||||
feedUpdateLock()->unlock();
|
feedUpdateLock()->unlock();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Request for write lock timed-out. This means
|
// Request for write lock timed-out. This means
|
||||||
// that some critical action can be processed right now.
|
// that some critical action can be processed right now.
|
||||||
qDebug("Close lock timed-out.");
|
qDebug("Close lock timed-out.");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Now, we can check if application should just quit or restart itself.
|
// Now, we can check if application should just quit or restart itself.
|
||||||
if (m_shouldRestart) {
|
if (m_shouldRestart) {
|
||||||
finish();
|
finish();
|
||||||
qDebug("Killing local peer connection to allow another instance to start.");
|
qDebug("Killing local peer connection to allow another instance to start.");
|
||||||
|
|
||||||
// TODO: Start RSS Guard with sleep before it cross-platform way if possible.
|
// TODO: Start RSS Guard with sleep before it cross-platform way if possible.
|
||||||
// sleep 5 && "<rssguard-start>".
|
// sleep 5 && "<rssguard-start>".
|
||||||
if (QProcess::startDetached(QString("\"") + QDir::toNativeSeparators(applicationFilePath()) + QString("\""))) {
|
if (QProcess::startDetached(QString("\"") + QDir::toNativeSeparators(applicationFilePath()) + QString("\""))) {
|
||||||
qDebug("New application instance was started.");
|
qDebug("New application instance was started.");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
qWarning("New application instance was not started successfully.");
|
qWarning("New application instance was not started successfully.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
void Application::restart() {
|
void Application::restart() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue