diff options
author | Petr Mrázek <peterix@gmail.com> | 2016-04-10 04:29:29 +0200 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2016-04-30 23:59:23 +0200 |
commit | 47e37635f50c09b4f9a9ee7699e3120bab3e4088 (patch) | |
tree | 061c2f675fb7e244ebe4b54ef206bfbd615c91f8 /logic/resources/ResourceHandler.h | |
parent | fcd4a482f759cd58ee319a51082d0146b7e426e2 (diff) | |
download | MultiMC-47e37635f50c09b4f9a9ee7699e3120bab3e4088.tar MultiMC-47e37635f50c09b4f9a9ee7699e3120bab3e4088.tar.gz MultiMC-47e37635f50c09b4f9a9ee7699e3120bab3e4088.tar.lz MultiMC-47e37635f50c09b4f9a9ee7699e3120bab3e4088.tar.xz MultiMC-47e37635f50c09b4f9a9ee7699e3120bab3e4088.zip |
NOISSUE split GUI stuff from logic library
Diffstat (limited to 'logic/resources/ResourceHandler.h')
-rw-r--r-- | logic/resources/ResourceHandler.h | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/logic/resources/ResourceHandler.h b/logic/resources/ResourceHandler.h deleted file mode 100644 index f09d8904..00000000 --- a/logic/resources/ResourceHandler.h +++ /dev/null @@ -1,36 +0,0 @@ -#pragma once - -#include <QVariant> -#include <memory> - -#include "multimc_logic_export.h" - -class Resource; - -/** Base class for things that can retrieve a resource. - * - * Subclass, provide a constructor that takes a single QString as argument, and - * call Resource::registerHandler<MyResourceHandler>("<id>"), where <id> is the - * prefix of the resource ("web", "icon", etc.) - */ -class MULTIMC_LOGIC_EXPORT ResourceHandler -{ -public: - virtual ~ResourceHandler() {} - - void setResource(Resource *resource) { m_resource = resource; } - /// reimplement this if you need to do something after you have been put in a shared pointer - // we do this instead of inheriting from std::enable_shared_from_this - virtual void init(std::shared_ptr<ResourceHandler>&) {} - - QVariant result() const { return m_result; } - -protected: // use these methods to notify the resource of changes - void setResult(const QVariant &result); - void setFailure(const QString &reason); - void setProgress(const int progress); - -private: - QVariant m_result; - Resource *m_resource = nullptr; -}; |