aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src-qt5/core/libLumina/DesktopSettings.cpp14
-rw-r--r--src-qt5/core/libLumina/DesktopSettings.h2
2 files changed, 14 insertions, 2 deletions
diff --git a/src-qt5/core/libLumina/DesktopSettings.cpp b/src-qt5/core/libLumina/DesktopSettings.cpp
index 30bd5bc2..bd0325ec 100644
--- a/src-qt5/core/libLumina/DesktopSettings.cpp
+++ b/src-qt5/core/libLumina/DesktopSettings.cpp
@@ -9,7 +9,7 @@
#include <QDir>
#include <QDebug>
-#include <unistd.h>
+#include <unistd.h>
#include <pwd.h>
#include <grp.h>
@@ -25,6 +25,16 @@ DesktopSettings::~DesktopSettings(){
if(!files.isEmpty()){ stop(); }
}
+DesktopSettings* DesktopSettings::instance(){
+ static DesktopSettings *set = 0;
+ if(set==0){
+ //First-time init
+ set = new DesktopSettings();
+ set->start();
+ }
+ return set;
+}
+
//Start/stop routines
void DesktopSettings::start(){
files.clear(); settings.clear(); //clear the internal hashes (just in case)
@@ -35,7 +45,7 @@ void DesktopSettings::start(){
}
parseSystemSettings(); //set the runmode appropriately
locateFiles(); //
-
+
}
void DesktopSettings::stop(){
diff --git a/src-qt5/core/libLumina/DesktopSettings.h b/src-qt5/core/libLumina/DesktopSettings.h
index 57eede9d..57a85791 100644
--- a/src-qt5/core/libLumina/DesktopSettings.h
+++ b/src-qt5/core/libLumina/DesktopSettings.h
@@ -30,6 +30,8 @@ public:
DesktopSettings(QObject *parent = 0);
~DesktopSettings();
+ static DesktopSettings* instance();
+
//Start/stop routines
void start();
void stop();
bgstack15