mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-11-19 14:32:26 -05:00
Guarantee that configuration values are committed to disk on exit
This commit is contained in:
parent
af9e1e79cd
commit
527868a6b3
8 changed files with 115 additions and 86 deletions
|
|
@ -26,15 +26,18 @@ class QSettings;
|
|||
|
||||
class Config : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
~Config();
|
||||
Q_DISABLE_COPY(Config)
|
||||
|
||||
~Config() override;
|
||||
QVariant get(const QString& key);
|
||||
QVariant get(const QString& key, const QVariant& defaultValue);
|
||||
QString getFileName();
|
||||
void set(const QString& key, const QVariant& value);
|
||||
bool hasAccessError();
|
||||
void sync();
|
||||
|
||||
static Config* instance();
|
||||
static void createConfigFromFile(const QString& file);
|
||||
|
|
@ -49,8 +52,6 @@ private:
|
|||
|
||||
QScopedPointer<QSettings> m_settings;
|
||||
QHash<QString, QVariant> m_defaults;
|
||||
|
||||
Q_DISABLE_COPY(Config)
|
||||
};
|
||||
|
||||
inline Config* config() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue