1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 10:46:35 +01:00

MainApplication: Sync settings after writing isRunning value

Fixes correctly detecting crashes during session restore.
This commit is contained in:
David Rosca 2018-01-06 20:01:59 +01:00
parent e41b0edf0a
commit ad3780e8df
3 changed files with 8 additions and 0 deletions

View File

@ -291,6 +291,7 @@ MainApplication::MainApplication(int &argc, char** argv)
settings.setValue(QSL("isRunning"), true); settings.setValue(QSL("isRunning"), true);
settings.setValue(QSL("isRestoring"), wasRunning); settings.setValue(QSL("isRestoring"), wasRunning);
settings.endGroup(); settings.endGroup();
settings.sync();
m_isStartingAfterCrash = wasRunning && wasRestoring; m_isStartingAfterCrash = wasRunning && wasRestoring;

View File

@ -76,6 +76,11 @@ void Settings::endGroup()
s_settings->endGroup(); s_settings->endGroup();
} }
void Settings::sync()
{
s_settings->sync();
}
QSettings* Settings::globalSettings() QSettings* Settings::globalSettings()
{ {
return s_settings; return s_settings;

View File

@ -47,6 +47,8 @@ public:
void beginGroup(const QString &prefix); void beginGroup(const QString &prefix);
void endGroup(); void endGroup();
void sync();
private: private:
static QSettings* s_settings; static QSettings* s_settings;
static QzSettings* s_qzSettings; static QzSettings* s_qzSettings;