15#ifndef WORKSPACE_STATE_H
16#define WORKSPACE_STATE_H
87 bool loadCommonState(QString *errorPath =
nullptr,
int *errorCode =
nullptr);
216 void onFileStatusChecked(
const QString &filename, qint64 size,
bool accessible);
226 bool parseRecentFile(
const QString &filePath,
227 std::function<
void(
const QString &key,
const QString &value)> handler);
234 void queueFileStatusCheck(
const QString &filename);
236 QList<RecentFileInfo> recent_capture_files_;
238 static constexpr const char *RECENT_COMMON_FILE_NAME =
"recent_common";
239 static constexpr const char *RECENT_PROFILE_FILE_NAME =
"recent";
240 static constexpr const char *KEY_CAPTURE_FILE =
"recent.capture_file";
241 static constexpr const char *THEMES_DIR_NAME =
"themes";
QString personalThemesPath() const
Get the path to the personal themes directory.
Definition workspace_state.cpp:75
bool loadCommonState(QString *errorPath=nullptr, int *errorCode=nullptr)
Load state from the recent_common file.
Definition workspace_state.cpp:133
WorkspaceState & operator=(const WorkspaceState &)=delete
Deleted assignment operator to enforce the singleton pattern.
QStringList recentCaptureFilenames() const
Get just the filenames of recent capture files.
Definition workspace_state.cpp:189
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:60
WorkspaceState(const WorkspaceState &)=delete
Deleted copy constructor to enforce the singleton pattern.
void addRecentCaptureFile(const QString &filePath)
Add a capture file to the recent files list.
Definition workspace_state.cpp:199
QString recentCommonFilePath() const
Get the path to the recent_common file.
Definition workspace_state.cpp:45
void stateLoaded()
Emitted when state is loaded from disk.
static WorkspaceState * instance()
Returns the singleton instance.
Definition workspace_state.cpp:38
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:184
static bool isDevelopmentBuild()
Check if this is a development build.
Definition workspace_state.cpp:304
static bool isPortableApplication()
Check if the application is running in portable mode. (Windows only).
Definition workspace_state.cpp:312
void clearRecentCaptureFiles()
Clear all recent capture files.
Definition workspace_state.cpp:259
void stateSaved()
Emitted when state is saved to disk.
virtual ~WorkspaceState()
Destroys the singleton and releases all owned resources.
Definition workspace_state.cpp:34
void removeRecentCaptureFile(const QString &filePath)
Remove a capture file from the recent files list.
Definition workspace_state.cpp:241
Information about a recent capture file.
Definition workspace_state.h:32
bool accessible
Definition workspace_state.h:35
QString filename
Definition workspace_state.h:33
qint64 size
Definition workspace_state.h:34