diff options
author | Ken Moore <ken@ixsystems.com> | 2017-07-05 13:23:25 -0400 |
---|---|---|
committer | Ken Moore <ken@ixsystems.com> | 2017-07-05 13:23:25 -0400 |
commit | c350293e4a3bccfbc255dec8e1eea35fe36c2b2d (patch) | |
tree | 6d0c247c5a265cdcf77e350baaeefdb8178e57c8 /src-qt5/core/libLumina/DesktopSettings.cpp | |
parent | Remove the "DEPENDENCIES" file from the overall project directory. Each indiv... (diff) | |
download | lumina-c350293e4a3bccfbc255dec8e1eea35fe36c2b2d.tar.gz lumina-c350293e4a3bccfbc255dec8e1eea35fe36c2b2d.tar.bz2 lumina-c350293e4a3bccfbc255dec8e1eea35fe36c2b2d.zip |
Add the ability to use a static "instance()" of the DesktopSettings class within a project
Diffstat (limited to 'src-qt5/core/libLumina/DesktopSettings.cpp')
-rw-r--r-- | src-qt5/core/libLumina/DesktopSettings.cpp | 14 |
1 files changed, 12 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(){ |