summaryrefslogtreecommitdiffstats
path: root/api/gui/icons/MMCIcon.cpp
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2016-05-03 00:27:28 +0200
committerPetr Mrázek <peterix@gmail.com>2016-05-03 00:27:28 +0200
commite1a530f84dce9b4c1b262669157359fbbd436428 (patch)
treecc372ad70b91977d1f038fe835a139cdf6bfb7d1 /api/gui/icons/MMCIcon.cpp
parentc50b3cdeec1ce30de7c67f62f026d689afe6930a (diff)
downloadMultiMC-e1a530f84dce9b4c1b262669157359fbbd436428.tar
MultiMC-e1a530f84dce9b4c1b262669157359fbbd436428.tar.gz
MultiMC-e1a530f84dce9b4c1b262669157359fbbd436428.tar.lz
MultiMC-e1a530f84dce9b4c1b262669157359fbbd436428.tar.xz
MultiMC-e1a530f84dce9b4c1b262669157359fbbd436428.zip
GH-1559 Fix FTB icons
This was caused by separation of GUI and logic. Now logic has an interface that GUI implements. It should be expanded upon later.
Diffstat (limited to 'api/gui/icons/MMCIcon.cpp')
-rw-r--r--api/gui/icons/MMCIcon.cpp32
1 files changed, 16 insertions, 16 deletions
diff --git a/api/gui/icons/MMCIcon.cpp b/api/gui/icons/MMCIcon.cpp
index 6b4eef39..f71281d0 100644
--- a/api/gui/icons/MMCIcon.cpp
+++ b/api/gui/icons/MMCIcon.cpp
@@ -16,19 +16,19 @@
#include "MMCIcon.h"
#include <QFileInfo>
-MMCIcon::Type operator--(MMCIcon::Type &t, int)
+IconType operator--(IconType &t, int)
{
- MMCIcon::Type temp = t;
+ IconType temp = t;
switch (t)
{
- case MMCIcon::Type::Builtin:
- t = MMCIcon::Type::ToBeDeleted;
+ case IconType::Builtin:
+ t = IconType::ToBeDeleted;
break;
- case MMCIcon::Type::Transient:
- t = MMCIcon::Type::Builtin;
+ case IconType::Transient:
+ t = IconType::Builtin;
break;
- case MMCIcon::Type::FileBased:
- t = MMCIcon::Type::Transient;
+ case IconType::FileBased:
+ t = IconType::Transient;
break;
default:
{
@@ -37,7 +37,7 @@ MMCIcon::Type operator--(MMCIcon::Type &t, int)
return temp;
}
-MMCIcon::Type MMCIcon::type() const
+IconType MMCIcon::type() const
{
return m_current_type;
}
@@ -49,23 +49,23 @@ QString MMCIcon::name() const
return m_key;
}
-bool MMCIcon::has(MMCIcon::Type _type) const
+bool MMCIcon::has(IconType _type) const
{
return m_images[_type].present();
}
QIcon MMCIcon::icon() const
{
- if (m_current_type == Type::ToBeDeleted)
+ if (m_current_type == IconType::ToBeDeleted)
return QIcon();
return m_images[m_current_type].icon;
}
-void MMCIcon::remove(Type rm_type)
+void MMCIcon::remove(IconType rm_type)
{
m_images[rm_type].filename = QString();
m_images[rm_type].icon = QIcon();
- for (auto iter = rm_type; iter != Type::ToBeDeleted; iter--)
+ for (auto iter = rm_type; iter != IconType::ToBeDeleted; iter--)
{
if (m_images[iter].present())
{
@@ -73,13 +73,13 @@ void MMCIcon::remove(Type rm_type)
return;
}
}
- m_current_type = Type::ToBeDeleted;
+ m_current_type = IconType::ToBeDeleted;
}
-void MMCIcon::replace(MMCIcon::Type new_type, QIcon icon, QString path)
+void MMCIcon::replace(IconType new_type, QIcon icon, QString path)
{
QFileInfo foo(path);
- if (new_type > m_current_type || m_current_type == MMCIcon::ToBeDeleted)
+ if (new_type > m_current_type || m_current_type == IconType::ToBeDeleted)
{
m_current_type = new_type;
}