]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphinmainwindow.h
DolphinMainWindow: autosave session
[dolphin.git] / src / dolphinmainwindow.h
index 551e28192700373103edce3709b39675e2f9ebdc..bff0ef4de8cac5d60908bc07ef80036832db98c7 100644 (file)
@@ -20,6 +20,7 @@
 #include "panels/information/informationpanel.h"
 #endif
 
+#include <QFutureWatcher>
 #include <QIcon>
 #include <QList>
 #include <QMenu>
@@ -116,6 +117,14 @@ public:
      */
     void setViewsToHomeIfMountPathOpen(const QString &mountPath);
 
+    /**
+     * Enables or disables the session autosaving feature.
+     *
+     * @param enable If true, saves the session automatically after a fixed
+     *               time interval from the last state change.
+     */
+    void setSessionAutoSaveEnabled(bool enable);
+
     bool isFoldersPanelEnabled() const;
     bool isInformationPanelEnabled() const;
     bool isSplitViewEnabledInCurrentTab() const;
@@ -619,6 +628,11 @@ private Q_SLOTS:
      */
     void slotKeyBindings();
 
+    /**
+     * Saves the session.
+     */
+    void slotSaveSession();
+
 private:
     /**
      * Sets up the various menus and actions and connects them.
@@ -718,6 +732,10 @@ private:
     QMenu m_searchTools;
     KFileItemActions m_fileItemActions;
 
+    QTimer *m_sessionSaveTimer;
+    QFutureWatcher<void> *m_sessionSaveWatcher;
+    bool m_sessionSaveScheduled;
+
     friend class DolphinMainWindowTest;
 };