diff options
Diffstat (limited to 'src-qt5/core')
-rw-r--r-- | src-qt5/core/libLumina/LIconCache.cpp | 5 | ||||
-rw-r--r-- | src-qt5/core/libLumina/LIconCache.h | 6 |
2 files changed, 11 insertions, 0 deletions
diff --git a/src-qt5/core/libLumina/LIconCache.cpp b/src-qt5/core/libLumina/LIconCache.cpp index cb88582d..38367cef 100644 --- a/src-qt5/core/libLumina/LIconCache.cpp +++ b/src-qt5/core/libLumina/LIconCache.cpp @@ -22,6 +22,11 @@ LIconCache::~LIconCache(){ } +LIconCache* LIconCache::instance(){ + static LIconCache cache; + return &cache; +} + // === PUBLIC === //Icon Checks bool LIconCache::exists(QString icon){ diff --git a/src-qt5/core/libLumina/LIconCache.h b/src-qt5/core/libLumina/LIconCache.h index cf585675..9834b2a3 100644 --- a/src-qt5/core/libLumina/LIconCache.h +++ b/src-qt5/core/libLumina/LIconCache.h @@ -35,6 +35,12 @@ class LIconCache : public QObject{ public: LIconCache(QObject *parent = 0); ~LIconCache(); + + //Static method for using this class (DO NOT MIX WITH GLOBAL OBJECT METHOD) + // Either use this the entire time, or use a saved/global object - pick one and stick with it + // otherwise you may end up with multiple icon cache's running for your application + static LIconCache* instance(); + //Icon Checks bool exists(QString icon); bool isLoaded(QString icon); |