aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core
diff options
context:
space:
mode:
authorKen Moore <ken@ixsystems.com>2017-06-08 07:26:13 -0400
committerKen Moore <ken@ixsystems.com>2017-06-08 07:26:13 -0400
commitf68dfe58d184d894524314b140a3fcda228c949b (patch)
treee584437416b5bf9aeddbe39367a4e33eca1fc572 /src-qt5/core
parentAdd the capability to be a bit smarter when determining a "fallback" icon for... (diff)
downloadlumina-f68dfe58d184d894524314b140a3fcda228c949b.tar.gz
lumina-f68dfe58d184d894524314b140a3fcda228c949b.tar.bz2
lumina-f68dfe58d184d894524314b140a3fcda228c949b.zip
Add a new method to find/use the LIconCache within an application (static instance as opposed to a global object).
Diffstat (limited to 'src-qt5/core')
-rw-r--r--src-qt5/core/libLumina/LIconCache.cpp5
-rw-r--r--src-qt5/core/libLumina/LIconCache.h6
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);
bgstack15