diff options
author | Andrew <forkk@forkk.net> | 2013-01-14 17:42:38 -0600 |
---|---|---|
committer | Andrew <forkk@forkk.net> | 2013-01-14 17:42:38 -0600 |
commit | fce0f5df045f1d956cabeda41406001a037c9ab7 (patch) | |
tree | 269c8dd0ceb5ca94ef3c708c9b225de7189b0719 /data/instancebase.cpp | |
parent | 586092cf9901dde873882c76cb3944cd0addbd2a (diff) | |
download | MultiMC-fce0f5df045f1d956cabeda41406001a037c9ab7.tar MultiMC-fce0f5df045f1d956cabeda41406001a037c9ab7.tar.gz MultiMC-fce0f5df045f1d956cabeda41406001a037c9ab7.tar.lz MultiMC-fce0f5df045f1d956cabeda41406001a037c9ab7.tar.xz MultiMC-fce0f5df045f1d956cabeda41406001a037c9ab7.zip |
Added stuff.
Diffstat (limited to 'data/instancebase.cpp')
-rw-r--r-- | data/instancebase.cpp | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/data/instancebase.cpp b/data/instancebase.cpp index 2e0a65df..15dc54f4 100644 --- a/data/instancebase.cpp +++ b/data/instancebase.cpp @@ -15,31 +15,35 @@ #include "instancebase.h" +#include <QFileInfo> + #include "../util/pathutils.h" -InstanceBase::InstanceBase(QString rootDir, QObject *parent) : +InstanceBase::InstanceBase(QString dir, QObject *parent) : QObject(parent), - m_rootDir(rootDir), - m_config(PathCombine(rootDir, "instance.cfg"), QSettings::IniFormat) + rootDir(dir) { + QFileInfo cfgFile; + if (cfgFile.exists()) + config.loadFile(PathCombine(rootDir, "instance.cfg")); } -QString InstanceBase::GetRootDir() const +QString InstanceBase::getRootDir() const { - return m_rootDir; + return rootDir; } ///////////// Config Values ///////////// // Name -QString InstanceBase::GetInstName() const +QString InstanceBase::getInstName() const { - return m_config.value("name", "Unnamed").toString(); + return config.get("name", "Unnamed").toString(); } -void InstanceBase::SetInstName(QString name) +void InstanceBase::setInstName(QString name) { - m_config.setValue("name", name); + config.set("name", name); } |