[app] Added BooksSaveTimer::saveNow() method
This commit is contained in:
parent
a89e489f7a
commit
9f1261a822
2 changed files with 10 additions and 4 deletions
|
@ -70,6 +70,13 @@ void BooksSaveTimer::cancelSave()
|
|||
iInactivityTimer->stop();
|
||||
}
|
||||
|
||||
void BooksSaveTimer::saveNow()
|
||||
{
|
||||
iMandatarySaveTimer->stop();
|
||||
iInactivityTimer->stop();
|
||||
Q_EMIT save();
|
||||
}
|
||||
|
||||
bool BooksSaveTimer::saveRequested() const
|
||||
{
|
||||
return iMandatarySaveTimer->isActive();
|
||||
|
@ -77,14 +84,12 @@ bool BooksSaveTimer::saveRequested() const
|
|||
|
||||
void BooksSaveTimer::onTimeout()
|
||||
{
|
||||
iMandatarySaveTimer->stop();
|
||||
iInactivityTimer->stop();
|
||||
Q_EMIT save();
|
||||
saveNow();
|
||||
}
|
||||
|
||||
void BooksSaveTimer::onAboutToQuit()
|
||||
{
|
||||
if (saveRequested()) {
|
||||
onTimeout();
|
||||
saveNow();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -48,6 +48,7 @@ public:
|
|||
void requestSave();
|
||||
void cancelSave();
|
||||
bool saveRequested() const;
|
||||
void saveNow();
|
||||
|
||||
Q_SIGNALS:
|
||||
void save();
|
||||
|
|
Loading…
Reference in a new issue