summaryrefslogtreecommitdiff
path: root/src/autosaver.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/autosaver.cpp')
-rw-r--r--src/autosaver.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/autosaver.cpp b/src/autosaver.cpp
index 4b83b65d..c1164e60 100644
--- a/src/autosaver.cpp
+++ b/src/autosaver.cpp
@@ -20,25 +20,26 @@
#include "autosaver.h"
-#include <QtCore/QDir>
-#include <QtCore/QCoreApplication>
-#include <QtCore/QMetaObject>
+#include <QtCore>
#include <QtDebug>
#define AUTOSAVE_IN 1000 * 3 // seconds
#define MAXWAIT 1000 * 15 // seconds
+
AutoSaver::AutoSaver(QObject *parent) : QObject(parent)
{
Q_ASSERT(parent);
}
+
AutoSaver::~AutoSaver()
{
if (m_timer.isActive())
qWarning() << "AutoSaver: still active when destroyed, changes not saved.";
}
+
void AutoSaver::changeOccurred()
{
if (m_firstChange.isNull())
@@ -51,6 +52,7 @@ void AutoSaver::changeOccurred()
}
}
+
void AutoSaver::timerEvent(QTimerEvent *event)
{
if (event->timerId() == m_timer.timerId()) {
@@ -60,6 +62,7 @@ void AutoSaver::timerEvent(QTimerEvent *event)
}
}
+
void AutoSaver::saveIfNeccessary()
{
if (!m_timer.isActive())