don't save settings on quit, if readSettings() not finished #56
@ -27,7 +27,8 @@ Core::Squawk::Squawk(QObject* parent):
|
|||||||
accounts(),
|
accounts(),
|
||||||
amap(),
|
amap(),
|
||||||
network(),
|
network(),
|
||||||
waitingForAccounts(0)
|
waitingForAccounts(0),
|
||||||
|
isInitialized(false)
|
||||||
#ifdef WITH_KWALLET
|
#ifdef WITH_KWALLET
|
||||||
,kwallet()
|
,kwallet()
|
||||||
#endif
|
#endif
|
||||||
@ -66,6 +67,8 @@ void Core::Squawk::stop()
|
|||||||
{
|
{
|
||||||
qDebug("Stopping squawk core..");
|
qDebug("Stopping squawk core..");
|
||||||
network.stop();
|
network.stop();
|
||||||
|
|
||||||
|
if (isInitialized) {
|
||||||
QSettings settings;
|
QSettings settings;
|
||||||
settings.beginGroup("core");
|
settings.beginGroup("core");
|
||||||
settings.beginWriteArray("accounts");
|
settings.beginWriteArray("accounts");
|
||||||
@ -99,6 +102,7 @@ void Core::Squawk::stop()
|
|||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
|
|
||||||
settings.sync();
|
settings.sync();
|
||||||
|
}
|
||||||
|
|
||||||
emit quit();
|
emit quit();
|
||||||
}
|
}
|
||||||
@ -108,6 +112,7 @@ void Core::Squawk::start()
|
|||||||
qDebug("Starting squawk core..");
|
qDebug("Starting squawk core..");
|
||||||
|
|
||||||
readSettings();
|
readSettings();
|
||||||
|
isInitialized = true;
|
||||||
network.start();
|
network.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -133,6 +133,7 @@ private:
|
|||||||
Shared::Availability state;
|
Shared::Availability state;
|
||||||
NetworkAccess network;
|
NetworkAccess network;
|
||||||
uint8_t waitingForAccounts;
|
uint8_t waitingForAccounts;
|
||||||
|
bool isInitialized;
|
||||||
|
|
||||||
#ifdef WITH_KWALLET
|
#ifdef WITH_KWALLET
|
||||||
PSE::KWallet kwallet;
|
PSE::KWallet kwallet;
|
||||||
|
Loading…
Reference in New Issue
Block a user