15#ifndef WORKSPACE_STATE_H
16#define WORKSPACE_STATE_H
35 bool accessible =
false;
77 bool loadCommonState(QString *errorPath =
nullptr,
int *errorCode =
nullptr);
158 void onFileStatusChecked(
const QString &filename, qint64 size,
bool accessible);
168 bool parseRecentFile(
const QString &filePath,
169 std::function<
void(
const QString &key,
const QString &value)> handler);
174 void queueFileStatusCheck(
const QString &filename);
176 QList<RecentFileInfo> recent_capture_files_;
178 static constexpr const char* RECENT_COMMON_FILE_NAME =
"recent_common";
179 static constexpr const char* RECENT_PROFILE_FILE_NAME =
"recent";
180 static constexpr const char* KEY_CAPTURE_FILE =
"recent.capture_file";
Manages workspace state that persists between sessions.
Definition workspace_state.h:51
bool loadCommonState(QString *errorPath=nullptr, int *errorCode=nullptr)
Load state from the recent_common file.
Definition workspace_state.cpp:106
QStringList recentCaptureFilenames() const
Get just the filenames of recent capture files.
Definition workspace_state.cpp:162
void recentCaptureFilesChanged()
Emitted when the recent capture files list changes.
QString recentProfileFilePath() const
Get the path to the profile-specific recent file.
Definition workspace_state.cpp:59
void addRecentCaptureFile(const QString &filePath)
Add a capture file to the recent files list.
Definition workspace_state.cpp:172
QString recentCommonFilePath() const
Get the path to the recent_common file.
Definition workspace_state.cpp:44
void stateLoaded()
Emitted when state is loaded from disk.
static WorkspaceState * instance()
Returns the singleton instance.
Definition workspace_state.cpp:37
void recentFileStatusChanged(const QString &filename)
Emitted when a file's status (size/accessibility) is updated.
const QList< RecentFileInfo > & recentCaptureFiles() const
Get the list of recently opened capture files.
Definition workspace_state.cpp:157
void clearRecentCaptureFiles()
Clear all recent capture files.
Definition workspace_state.cpp:230
void stateSaved()
Emitted when state is saved to disk.
void removeRecentCaptureFile(const QString &filePath)
Remove a capture file from the recent files list.
Definition workspace_state.cpp:210
Information about a recent capture file.
Definition workspace_state.h:32