summaryrefslogtreecommitdiff
path: root/g_property.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'g_property.cpp')
-rw-r--r--g_property.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/g_property.cpp b/g_property.cpp
new file mode 100644
index 0000000..a852081
--- /dev/null
+++ b/g_property.cpp
@@ -0,0 +1,29 @@
+#include "g_property.h"
+
+// qt
+#include <QCoreApplication>
+
+QSharedPointer<GlobalSettings> GlobalSettings::m_instance;
+
+QSharedPointer<GlobalSettings> GlobalSettings::instance()
+{
+ if (!m_instance)
+ m_instance.reset(new GlobalSettings(
+ QSettings::IniFormat,
+ QSettings::UserScope,
+ QCoreApplication::organizationName(),
+ QCoreApplication::applicationName()
+ ));
+
+ return m_instance;
+}
+
+GlobalSettings::GlobalSettings(
+ QSettings::Format format,
+ QSettings::Scope scope,
+ const QString& organization,
+ const QString& application
+)
+ : QSettings(format, scope, organization, application)
+{
+}