summaryrefslogtreecommitdiffstats
path: root/logic/BaseInstance.cpp
diff options
context:
space:
mode:
authorJan Dalheimer <jan@dalheimer.de>2014-02-17 20:31:50 +0100
committerJan Dalheimer <jan@dalheimer.de>2014-02-17 20:31:50 +0100
commit0b56b5efafffca77d6deee966097c55e78fb0aef (patch)
treeddb7011fde89c587b864a8c1d6d36cdcaef6472b /logic/BaseInstance.cpp
parent4e8be668cb9b3c4929748aafb1baf53e6b1c098b (diff)
downloadMultiMC-0b56b5efafffca77d6deee966097c55e78fb0aef.tar
MultiMC-0b56b5efafffca77d6deee966097c55e78fb0aef.tar.gz
MultiMC-0b56b5efafffca77d6deee966097c55e78fb0aef.tar.lz
MultiMC-0b56b5efafffca77d6deee966097c55e78fb0aef.tar.xz
MultiMC-0b56b5efafffca77d6deee966097c55e78fb0aef.zip
Instance flags. Currently used for marking instances as broken. Can later be used for badges.
Diffstat (limited to 'logic/BaseInstance.cpp')
-rw-r--r--logic/BaseInstance.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/logic/BaseInstance.cpp b/logic/BaseInstance.cpp
index 222004a3..d78f1ea0 100644
--- a/logic/BaseInstance.cpp
+++ b/logic/BaseInstance.cpp
@@ -37,6 +37,7 @@ BaseInstance::BaseInstance(BaseInstancePrivate *d_in, const QString &rootDir,
I_D(BaseInstance);
d->m_settings = settings_obj;
d->m_rootDir = rootDir;
+ d->m_flags = 0;
settings().registerSetting("name", "Unnamed Instance");
settings().registerSetting("iconKey", "default");
@@ -146,6 +147,28 @@ SettingsObject &BaseInstance::settings() const
return *d->m_settings;
}
+BaseInstance::InstanceFlags BaseInstance::flags() const
+{
+ I_D(const BaseInstance);
+ return InstanceFlags(d->m_flags);
+}
+
+void BaseInstance::setFlags(const BaseInstance::InstanceFlags flags)
+{
+ I_D(BaseInstance);
+ if (flags != d->m_flags)
+ {
+ d->m_flags = flags;
+ emit flagsChanged();
+ emit propertiesChanged(this);
+ }
+}
+
+bool BaseInstance::canLaunch() const
+{
+ return !(flags() & VersionBrokenFlag);
+}
+
QString BaseInstance::baseJar() const
{
I_D(BaseInstance);