summaryrefslogtreecommitdiffstats
path: root/api/dead/src/handlers/IconResourceHandler.h
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2016-04-10 17:01:24 +0200
committerPetr Mrázek <peterix@gmail.com>2016-05-01 00:00:24 +0200
commit1be7d573326570d63e55e36235537ed2b1831ae1 (patch)
treeba7037671cde8688e87e69acb753df80ec4cd4f9 /api/dead/src/handlers/IconResourceHandler.h
parentaa4842a91d35481264ae5a7c0ac17ea43610b600 (diff)
downloadMultiMC-1be7d573326570d63e55e36235537ed2b1831ae1.tar
MultiMC-1be7d573326570d63e55e36235537ed2b1831ae1.tar.gz
MultiMC-1be7d573326570d63e55e36235537ed2b1831ae1.tar.lz
MultiMC-1be7d573326570d63e55e36235537ed2b1831ae1.tar.xz
MultiMC-1be7d573326570d63e55e36235537ed2b1831ae1.zip
NOISSUE re/move some dead code and unused build system parts
Diffstat (limited to 'api/dead/src/handlers/IconResourceHandler.h')
-rw-r--r--api/dead/src/handlers/IconResourceHandler.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/api/dead/src/handlers/IconResourceHandler.h b/api/dead/src/handlers/IconResourceHandler.h
new file mode 100644
index 00000000..0cc4de4f
--- /dev/null
+++ b/api/dead/src/handlers/IconResourceHandler.h
@@ -0,0 +1,23 @@
+#pragma once
+
+#include <memory>
+#include <resources/ResourceHandler.h>
+
+class IconResourceHandler : public ResourceHandler
+{
+public:
+ explicit IconResourceHandler(const QString &key);
+
+ /// Sets the current theme and notifies all IconResourceHandlers of the change
+ static void setTheme(const QString &theme);
+
+private:
+ // we need to keep track of all IconResourceHandlers so that we can update them if the theme changes
+ void init(std::shared_ptr<ResourceHandler> &ptr) override;
+ static QList<std::weak_ptr<IconResourceHandler>> m_iconHandlers;
+
+ QString m_key;
+
+ // the workhorse, returns QVariantMap (filename => size) for m_key/m_theme
+ QVariant get() const;
+};