2015-05-28 23:08:29 +05:30
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
|
|
|
|
#include "ResourceHandler.h"
|
|
|
|
|
2015-09-05 22:16:57 +05:30
|
|
|
#include "multimc_logic_export.h"
|
|
|
|
|
|
|
|
class MULTIMC_LOGIC_EXPORT IconResourceHandler : public ResourceHandler
|
2015-05-28 23:08:29 +05:30
|
|
|
{
|
|
|
|
public:
|
|
|
|
explicit IconResourceHandler(const QString &key);
|
|
|
|
|
2015-06-06 16:00:49 +05:30
|
|
|
/// Sets the current theme and notifies all IconResourceHandlers of the change
|
2015-05-28 23:08:29 +05:30
|
|
|
static void setTheme(const QString &theme);
|
|
|
|
|
|
|
|
private:
|
2015-06-06 16:00:49 +05:30
|
|
|
// we need to keep track of all IconResourceHandlers so that we can update them if the theme changes
|
2015-05-28 23:08:29 +05:30
|
|
|
void init(std::shared_ptr<ResourceHandler> &ptr) override;
|
2015-06-06 16:00:49 +05:30
|
|
|
static QList<std::weak_ptr<IconResourceHandler>> m_iconHandlers;
|
2015-05-28 23:08:29 +05:30
|
|
|
|
|
|
|
QString m_key;
|
|
|
|
static QString m_theme;
|
|
|
|
|
2015-06-06 16:00:49 +05:30
|
|
|
// the workhorse, returns QVariantMap (filename => size) for m_key/m_theme
|
2015-05-28 23:08:29 +05:30
|
|
|
QVariant get() const;
|
|
|
|
};
|