|
LogViewer
A modern log viewer with AI-assisted analysis (Qt 6)
|
Manages session state (open files, filters, scroll position, etc.) More...
#include <SessionManager.hpp>

Classes | |
| struct | SessionState |
Public Member Functions | |
| void | initialize () |
| Initialize session manager. | |
| bool | hasCrashRecovery () const |
| Check if crash recovery is available. | |
| SessionState | getCrashRecoveryState () const |
| Get crash recovery state. | |
| void | saveSession (const SessionState &state) |
| Save current session state. | |
| SessionState | loadSession () |
| Load last session state. | |
| void | clearCrashFlag () |
| Clear crash recovery flag (session completed successfully) | |
| void | setCrashFlag () |
| Set crash recovery flag (session interrupted abnormally) | |
| void | autoSave (const SessionState &state) |
| Auto-save session periodically (call from main event loop) | |
| void | setAutoSaveEnabled (bool enabled) |
| Enable/disable auto-save. | |
| bool | isAutoSaveEnabled () const |
| std::string | getSessionFilePath () const |
| Get session file path. | |
| std::string | getCrashRecoveryFilePath () const |
| Get crash recovery file path. | |
Static Public Member Functions | |
| static SessionManager & | getInstance () |
Private Member Functions | |
| SessionManager ()=default | |
Private Attributes | |
| std::string | m_sessionFilePath |
| std::string | m_crashRecoveryFilePath |
| bool | m_autoSaveEnabled {true} |
| bool | m_hasCrashRecovery {false} |
| std::chrono::steady_clock::time_point | m_lastAutoSaveTime |
Static Private Attributes | |
| static constexpr std::chrono::milliseconds | kAutoSaveInterval {30000} |
Manages session state (open files, filters, scroll position, etc.)
Automatically saves state periodically and on shutdown. Allows recovery from crashes with user confirmation.
|
privatedefault |
| void ui::qt::utils::SessionManager::autoSave | ( | const SessionState & | state | ) |
Auto-save session periodically (call from main event loop)

| void ui::qt::utils::SessionManager::clearCrashFlag | ( | ) |
Clear crash recovery flag (session completed successfully)

|
inline |
Get crash recovery file path.
| SessionManager::SessionState ui::qt::utils::SessionManager::getCrashRecoveryState | ( | ) | const |
Get crash recovery state.

|
static |
|
inline |
Get session file path.
| bool ui::qt::utils::SessionManager::hasCrashRecovery | ( | ) | const |
Check if crash recovery is available.
| void ui::qt::utils::SessionManager::initialize | ( | ) |
Initialize session manager.

|
inline |
| SessionManager::SessionState ui::qt::utils::SessionManager::loadSession | ( | ) |
Load last session state.

| void ui::qt::utils::SessionManager::saveSession | ( | const SessionState & | state | ) |
Save current session state.


|
inline |
Enable/disable auto-save.
| void ui::qt::utils::SessionManager::setCrashFlag | ( | ) |
Set crash recovery flag (session interrupted abnormally)
|
staticconstexprprivate |
|
private |
|
private |
|
private |
|
private |
|
private |