Sync from quickmods
This commit is contained in:
@ -29,6 +29,7 @@
|
||||
#include <cmdutils.h>
|
||||
#include "logic/minecraft/MinecraftVersionList.h"
|
||||
#include "logic/icons/IconList.h"
|
||||
#include "logic/InstanceList.h"
|
||||
|
||||
BaseInstance::BaseInstance(BaseInstancePrivate *d_in, const QString &rootDir,
|
||||
SettingsObject *settings_obj, QObject *parent)
|
||||
@ -143,10 +144,12 @@ QString BaseInstance::minecraftRoot() const
|
||||
|
||||
InstanceList *BaseInstance::instList() const
|
||||
{
|
||||
if (parent()->inherits("InstanceList"))
|
||||
return (InstanceList *)parent();
|
||||
else
|
||||
return NULL;
|
||||
return qobject_cast<InstanceList *>(parent());
|
||||
}
|
||||
|
||||
InstancePtr BaseInstance::getSharedPtr()
|
||||
{
|
||||
return instList()->getInstanceById(id());
|
||||
}
|
||||
|
||||
std::shared_ptr<BaseVersionList> BaseInstance::versionList() const
|
||||
@ -160,13 +163,12 @@ SettingsObject &BaseInstance::settings() const
|
||||
return *d->m_settings;
|
||||
}
|
||||
|
||||
QSet<BaseInstance::InstanceFlag> BaseInstance::flags() const
|
||||
BaseInstance::InstanceFlags BaseInstance::flags() const
|
||||
{
|
||||
I_D(const BaseInstance);
|
||||
return QSet<InstanceFlag>(d->m_flags);
|
||||
return d->m_flags;
|
||||
}
|
||||
|
||||
void BaseInstance::setFlags(const QSet<InstanceFlag> &flags)
|
||||
void BaseInstance::setFlags(const InstanceFlags &flags)
|
||||
{
|
||||
I_D(BaseInstance);
|
||||
if (flags != d->m_flags)
|
||||
@ -176,10 +178,24 @@ void BaseInstance::setFlags(const QSet<InstanceFlag> &flags)
|
||||
emit propertiesChanged(this);
|
||||
}
|
||||
}
|
||||
void BaseInstance::setFlag(const BaseInstance::InstanceFlag flag)
|
||||
{
|
||||
I_D(BaseInstance);
|
||||
d->m_flags |= flag;
|
||||
emit flagsChanged();
|
||||
emit propertiesChanged(this);
|
||||
}
|
||||
void BaseInstance::unsetFlag(const BaseInstance::InstanceFlag flag)
|
||||
{
|
||||
I_D(BaseInstance);
|
||||
d->m_flags &= ~flag;
|
||||
emit flagsChanged();
|
||||
emit propertiesChanged(this);
|
||||
}
|
||||
|
||||
bool BaseInstance::canLaunch() const
|
||||
{
|
||||
return !flags().contains(VersionBrokenFlag);
|
||||
return !(flags() & VersionBrokenFlag);
|
||||
}
|
||||
|
||||
bool BaseInstance::reload()
|
||||
|
Reference in New Issue
Block a user