Commit 6b32bea8 authored by Halla Rempt's avatar Halla Rempt
Browse files

Try to make the autosave saver.

CCBUG:310310
parent 8ef7f458
......@@ -71,6 +71,7 @@
#include <QTimer>
#include <QtDBus/QDBusConnection>
#include <QApplication>
#include <QMutex>
// Define the protocol used here for embedded documents' URL
// This used to "store" but KUrl didn't like it,
......@@ -99,6 +100,9 @@ QString KoDocument::newObjectName()
return name;
}
static QMutex s_autosaveMutex;
class KoDocument::Private
{
public:
......@@ -472,6 +476,8 @@ bool KoDocument::isAutoErrorHandlingEnabled() const
void KoDocument::slotAutoSave()
{
s_autosaveMutex.lock();
if (!d->parentPart) return;
if (isModified() && d->modifiedAfterAutosave && !d->isLoading) {
// Give a warning when trying to autosave an encrypted file when no password is known (should not happen)
if (d->specialOutputFlag == SaveEncrypted && d->password.isNull()) {
......@@ -495,6 +501,7 @@ void KoDocument::slotAutoSave()
}
}
}
s_autosaveMutex.unlock();
}
void KoDocument::setReadWrite(bool readwrite)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment