diff options
Diffstat (limited to 'src/autosaver.cpp')
-rw-r--r-- | src/autosaver.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/autosaver.cpp b/src/autosaver.cpp index a2ec7be5..b09f35e9 100644 --- a/src/autosaver.cpp +++ b/src/autosaver.cpp @@ -52,9 +52,12 @@ void AutoSaver::changeOccurred() if (m_firstChange.isNull()) m_firstChange.start(); - if (m_firstChange.elapsed() > MAXWAIT) { + if (m_firstChange.elapsed() > MAXWAIT) + { saveIfNeccessary(); - } else { + } + else + { m_timer.start(AUTOSAVE_IN, this); } } @@ -62,9 +65,12 @@ void AutoSaver::changeOccurred() void AutoSaver::timerEvent(QTimerEvent *event) { - if (event->timerId() == m_timer.timerId()) { + if (event->timerId() == m_timer.timerId()) + { saveIfNeccessary(); - } else { + } + else + { QObject::timerEvent(event); } } @@ -76,7 +82,7 @@ void AutoSaver::saveIfNeccessary() return; m_timer.stop(); m_firstChange = QTime(); - if (!QMetaObject::invokeMethod(parent(), "save", Qt::DirectConnection)) + if (!QMetaObject::invokeMethod(parent(), "save", Qt::DirectConnection)) { kWarning() << "AutoSaver: error invoking slot save() on parent"; } |