diff options
| author | Amol Godbole <[email protected]> | 2023-11-09 11:05:48 -0600 |
|---|---|---|
| committer | Méven Car <[email protected]> | 2024-01-14 08:34:58 +0000 |
| commit | c035e95e1d74fecd8267b08009c616232e2c16b0 (patch) | |
| tree | 2b3893a51722c426db9a3acf5b85ad0c645f9be4 /src/dolphinmainwindow.h | |
| parent | f15c8d9238124641b1d93a101b69e9a5651b5028 (diff) | |
DolphinMainWindow: autosave session
Currently, the session is saved only when the app quits normally. Save
the session after a fixed time interval from the last state change i.e.
anytime the url is changed, or a tab is opened or closed, or the active
view is changed.
BUG: 425627
Diffstat (limited to 'src/dolphinmainwindow.h')
| -rw-r--r-- | src/dolphinmainwindow.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/dolphinmainwindow.h b/src/dolphinmainwindow.h index 551e28192..bff0ef4de 100644 --- a/src/dolphinmainwindow.h +++ b/src/dolphinmainwindow.h @@ -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; }; |
