|
QtPass 2.0.0
Developer documentation
|
Singleton that stores QtPass settings, handles persistence and defaults. More...
#include <qtpasssettings.h>
Static Public Member Functions | |
| static auto | getInstance () -> QtPassSettings * |
| Get the singleton instance. | |
| static auto | load () -> AppSettings |
| Load all flat settings into an AppSettings value object. | |
| static void | save (const AppSettings &settings) |
| Persist an AppSettings value object to the singleton store. | |
| static auto | getVersion (const QString &defaultValue=QVariant().toString()) -> QString |
| Get saved application version. | |
| static void | setVersion (const QString &version) |
| Save application version. | |
| static auto | getGeometry (const QByteArray &defaultValue=QVariant().toByteArray()) -> QByteArray |
| Get saved window geometry. | |
| static void | setGeometry (const QByteArray &geometry) |
| Save window geometry. | |
| static auto | getSavestate (const QByteArray &defaultValue=QVariant().toByteArray()) -> QByteArray |
| Get saved window state. | |
| static void | setSavestate (const QByteArray &saveState) |
| Save window state. | |
| static auto | getDialogGeometry (const QString &key, const QByteArray &defaultValue=QVariant().toByteArray()) -> QByteArray |
| Get saved dialog geometry. | |
| static void | setDialogGeometry (const QString &key, const QByteArray &geometry) |
| Save dialog geometry. | |
| static void | setUsePass (const bool &usePass) |
| Save use pass setting. | |
| static auto | getAutoclearSeconds (const int &defaultValue=QVariant().toInt()) -> int |
| Get autoclear delay in seconds. | |
| static auto | getPassStore (const QString &defaultValue=QVariant().toString()) -> QString |
| Get password store directory path. | |
| static void | setPassStore (const QString &passStore) |
| Save password store path. | |
| static void | initExecutables () |
| Initialize executable paths by auto-detecting them. | |
| static auto | getPassExecutable (const QString &defaultValue=QVariant().toString()) -> QString |
| Get pass executable path. | |
| static auto | getProfile (const QString &defaultValue=QVariant().toString()) -> QString |
| Get active profile name. | |
| static auto | isUseGit (const bool &defaultValue=QVariant().toBool()) -> bool |
| Check whether Git integration is enabled. | |
| static auto | isUseGrepSearch (const bool &defaultValue=false) -> bool |
| Check whether content search is enabled. | |
| static auto | isUseOtp (const bool &defaultValue=true) -> bool |
| Check whether OTP support is enabled. | |
| static void | setQrencodeExecutable (const QString &qrencodeExecutable) |
| Save qrencode executable path. | |
| static auto | getPasswordConfiguration () -> PasswordConfiguration |
| Get complete password generation configuration. | |
| static auto | isHideOnClose (const bool &defaultValue=QVariant().toBool()) -> bool |
| Check whether closing the window hides the application. | |
| static auto | isAlwaysOnTop (const bool &defaultValue=QVariant().toBool()) -> bool |
| Check whether main window should stay always on top. | |
| static auto | isAutoPush (const bool &defaultValue=QVariant().toBool()) -> bool |
| Check whether automatic push is enabled. | |
| static auto | isShowProcessOutput (const bool &defaultValue=false) -> bool |
| Get showProcessOutput setting. | |
| static auto | getProfiles () -> Profiles |
| Get all configured profiles. | |
| static void | setProfiles (const Profiles &profiles) |
| Save all configured profiles. | |
| static auto | getPass () -> Pass * |
| Get currently active pass backend instance. | |
| static auto | getRealPass () -> RealPass * |
| Get real pass backend instance. | |
| static auto | getImitatePass () -> ImitatePass * |
| Get imitate pass backend instance. | |
| static auto | backendsIdle () -> bool |
| Whether no backend, the active one or one kept from before a switch, runs or waits for anything (PassBackendFactory::isIdle()). | |
Private Member Functions | |
| QtPassSettings ()=delete | |
| Private default constructor to enforce singleton usage and prevent direct instantiation. | |
| QtPassSettings (const QString &organization, const QSettings::Format format) | |
| Settings in an explicit file: the portable qtpass.ini next to the executable, which getInstance() prefers when it exists. | |
| QtPassSettings (const QString &organization, const QString &application) | |
| Per-user settings in QSettings::defaultFormat(). | |
Static Private Attributes | |
| static bool | initialized = false |
| Whether getInstance() has chosen the store and built m_instance. | |
| static QtPassSettings * | m_instance = nullptr |
Singleton that stores QtPass settings, handles persistence and defaults.
QtPassSettings manages all application configuration including:
Uses QSettings for persistence with a singleton pattern. All getters accept a default value returned when setting is not yet saved.
Definition at line 42 of file qtpasssettings.h.
|
explicitprivatedelete |
Private default constructor to enforce singleton usage and prevent direct instantiation.
|
inlineprivate |
Settings in an explicit file: the portable qtpass.ini next to the executable, which getInstance() prefers when it exists.
| organization | The file's path (QSettings' file-name constructor). |
| format | The file's format; IniFormat for the portable file. |
Definition at line 56 of file qtpasssettings.h.
|
inlineprivate |
Per-user settings in QSettings::defaultFormat().
QSettings(organization, application) ignores setDefaultFormat() and always uses NativeFormat; going through the explicit-format constructor keeps the production default (NativeFormat) while letting the test suites redirect settings to an ini file in a temporary directory.
| organization | The organisation the settings are filed under ("IJHack"). |
| application | The application name ("QtPass"). |
Definition at line 69 of file qtpasssettings.h.
|
static |
Whether no backend, the active one or one kept from before a switch, runs or waits for anything (PassBackendFactory::isIdle()).
Definition at line 289 of file qtpasssettings.cpp.
|
static |
Get autoclear delay in seconds.
| defaultValue | Integer returned if not saved. |
Definition at line 176 of file qtpasssettings.cpp.
|
static |
Get saved dialog geometry.
| key | Dialog identifier (e.g., "usersDialog"). |
| defaultValue | Byte array returned if not saved. |
Definition at line 157 of file qtpasssettings.cpp.
|
static |
Get saved window geometry.
| defaultValue | Byte array returned if no geometry saved. |
Definition at line 138 of file qtpasssettings.cpp.
|
static |
Get imitate pass backend instance.
Definition at line 285 of file qtpasssettings.cpp.
|
static |
Get the singleton instance.
Definition at line 31 of file qtpasssettings.cpp.
|
static |
Get currently active pass backend instance.
Definition at line 125 of file qtpasssettings.cpp.
|
static |
Get pass executable path.
| defaultValue | String returned if not saved. |
Definition at line 221 of file qtpasssettings.cpp.
|
static |
Get password store directory path.
| defaultValue | String returned if not saved. |
Definition at line 182 of file qtpasssettings.cpp.
|
static |
Get complete password generation configuration.
Definition at line 63 of file qtpasssettings.cpp.
|
static |
Get active profile name.
| defaultValue | String returned if not saved. |
Definition at line 227 of file qtpasssettings.cpp.
|
static |
Get all configured profiles.
Definition at line 67 of file qtpasssettings.cpp.
|
static |
Get real pass backend instance.
Definition at line 282 of file qtpasssettings.cpp.
|
static |
Get saved window state.
| defaultValue | Byte array returned if no state saved. |
Definition at line 147 of file qtpasssettings.cpp.
|
static |
Get saved application version.
| defaultValue | String returned if no version saved. |
Definition at line 129 of file qtpasssettings.cpp.
|
static |
Initialize executable paths by auto-detecting them.
Definition at line 206 of file qtpasssettings.cpp.
|
static |
Check whether main window should stay always on top.
| defaultValue | Value returned if not saved. |
Definition at line 265 of file qtpasssettings.cpp.
|
static |
Check whether automatic push is enabled.
| defaultValue | Value returned if not saved. |
Definition at line 271 of file qtpasssettings.cpp.
|
static |
Check whether closing the window hides the application.
| defaultValue | Value returned if not saved. |
Definition at line 260 of file qtpasssettings.cpp.
|
static |
Get showProcessOutput setting.
| defaultValue | Default value if not set. |
Definition at line 277 of file qtpasssettings.cpp.
|
static |
Check whether Git integration is enabled.
| defaultValue | Value returned if not saved. |
Definition at line 233 of file qtpasssettings.cpp.
|
static |
Check whether content search is enabled.
| defaultValue | Value returned if not saved (defaults to false). |
Definition at line 245 of file qtpasssettings.cpp.
|
static |
Check whether OTP support is enabled.
| defaultValue | Value returned if not saved (defaults to true). |
Definition at line 251 of file qtpasssettings.cpp.
|
static |
Load all flat settings into an AppSettings value object.
Convenience facade over SettingsSerializer using the singleton store. Note: nested/keyed settings (profiles, per-dialog geometry) are not part of AppSettings and still use their dedicated accessors.
Definition at line 47 of file qtpasssettings.cpp.
|
static |
Persist an AppSettings value object to the singleton store.
Writes via SettingsSerializer and invalidates the cached Pass backend so a changed "use pass" mode takes effect on the next getPass().
| settings | Values to save. |
Definition at line 57 of file qtpasssettings.cpp.
|
static |
Save dialog geometry.
| key | Dialog identifier. |
| geometry | Dialog geometry to save. |
Definition at line 164 of file qtpasssettings.cpp.
|
static |
Save window geometry.
| geometry | Window geometry to save. |
Definition at line 143 of file qtpasssettings.cpp.
|
static |
Save password store path.
| passStore | Path to password store. |
Definition at line 203 of file qtpasssettings.cpp.
|
static |
Save all configured profiles.
| profiles | Profile map keyed by profile name. |
Definition at line 99 of file qtpasssettings.cpp.
|
static |
Save qrencode executable path.
| qrencodeExecutable | Path to qrencode executable. |
Definition at line 255 of file qtpasssettings.cpp.
|
static |
Save window state.
| saveState | Window state to save. |
Definition at line 153 of file qtpasssettings.cpp.
|
static |
Save use pass setting.
| usePass | true to use pass, false for GPG. |
Definition at line 170 of file qtpasssettings.cpp.
|
static |
Save application version.
| version | Version string to save. |
Definition at line 134 of file qtpasssettings.cpp.
|
staticprivate |
Whether getInstance() has chosen the store and built m_instance.
Definition at line 76 of file qtpasssettings.h.
|
staticprivate |
The one instance, built on the first getInstance() and kept for the life of the process.
Definition at line 79 of file qtpasssettings.h.