mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2026-12-06 00:32:40 -08:00
Move singleton instance code to static member functions.
This commit is contained in:
1 parent
8d6b200dd7
commit
d3fcf2e0c4
10 files changed
+65
-45
No files matched your search
+6
-6
@@ -21,6 +21,8 @@
|
||||
#include <QtCore/QSettings>
|
||||
#include <QtGui/QDesktopServices>
|
||||
|
||||
Config* Config::m_instance(0);
|
||||
|
||||
QVariant Config::get(const QString& key)
|
||||
{
|
||||
return m_settings->value(key, m_defaults.value(key));
|
||||
@@ -73,13 +75,11 @@ Config::Config()
|
||||
m_defaults.insert("security/clearclipboardtimeout", 10);
|
||||
}
|
||||
|
||||
Config* config()
|
||||
Config* Config::instance()
|
||||
{
|
||||
static Config* instance(0);
|
||||
|
||||
if (!instance) {
|
||||
instance = new Config();
|
||||
if (!m_instance) {
|
||||
m_instance = new Config();
|
||||
}
|
||||
|
||||
return instance;
|
||||
return m_instance;
|
||||
}
|
||||
Reference in new issue
Block a user