1
mirror of https://invent.kde.org/network/falkon.git synced 2024-09-21 17:52:10 +02:00

AutoSaver: Save when app is about to quit

Fixes changes not being saved in classes where saving is done in destructor,
like SpeedDial.
This commit is contained in:
David Rosca 2018-04-18 10:09:07 +02:00
parent 30f5cd2d7e
commit 82a9c398a6
No known key found for this signature in database
GPG Key ID: EBC3FC294452C6D8

View File

@ -18,12 +18,14 @@
#include "autosaver.h" #include "autosaver.h"
#include <QTimerEvent> #include <QTimerEvent>
#include <QCoreApplication>
#define SAVE_DELAY 1000 * 10 // 10 seconds #define SAVE_DELAY 1000 * 10 // 10 seconds
AutoSaver::AutoSaver(QObject* parent) AutoSaver::AutoSaver(QObject* parent)
: QObject(parent) : QObject(parent)
{ {
connect(qApp, &QCoreApplication::aboutToQuit, this, &AutoSaver::saveIfNecessary);
} }
void AutoSaver::saveIfNecessary() void AutoSaver::saveIfNecessary()