X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcore%2Fcore.cpp;h=4826c3ecc60ef7bbd8449d5af182562085a8dc97;hp=2024387e640ec78bb275ae36f6243c49ba1b7e97;hb=59579d82e3a16a815a197a4300c8ef279275ccfc;hpb=23ebdc0a422294764ff3be3f8d7e56cc2b323185 diff --git a/src/core/core.cpp b/src/core/core.cpp index 2024387e..4826c3ec 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp @@ -49,6 +49,10 @@ Core::Core() : storage(0) { startTime = QDateTime::currentDateTime(); // for uptime :) + + connect(&_storageSyncTimer, SIGNAL(timeout()), + this, SLOT(syncStorage())); + _storageSyncTimer.start(10 * 60 * 1000); // in msecs } void Core::init() { @@ -95,6 +99,11 @@ Core::~Core() { qDeleteAll(sessions); } +void Core::syncStorage() { + QMutexLocker locker(&mutex); + return instance()->storage->sync(); +} + void Core::restoreState() { if(instance()->sessions.count()) { qWarning() << qPrintable(tr("Calling restoreState() even though active sessions exist!"));