summaryrefslogtreecommitdiffstats
path: root/libinstance
diff options
context:
space:
mode:
authorAndrew <forkk@forkk.net>2013-02-25 13:24:46 -0600
committerAndrew <forkk@forkk.net>2013-02-25 13:24:46 -0600
commit498225debdb22d83e591635dbd172cca12476279 (patch)
treee26d8f8de3bed7d22cfc25ee010c999b9481ec87 /libinstance
parenta7111b132873e0f1e00221b2ad734454d69889e3 (diff)
downloadMultiMC-498225debdb22d83e591635dbd172cca12476279.tar
MultiMC-498225debdb22d83e591635dbd172cca12476279.tar.gz
MultiMC-498225debdb22d83e591635dbd172cca12476279.tar.lz
MultiMC-498225debdb22d83e591635dbd172cca12476279.tar.xz
MultiMC-498225debdb22d83e591635dbd172cca12476279.zip
Rewrote the settings system. It may still need some work.
Diffstat (limited to 'libinstance')
-rw-r--r--libinstance/include/instance.h36
-rw-r--r--libinstance/src/instance.cpp2
2 files changed, 2 insertions, 36 deletions
diff --git a/libinstance/include/instance.h b/libinstance/include/instance.h
index 7b3c001d..b99d9953 100644
--- a/libinstance/include/instance.h
+++ b/libinstance/include/instance.h
@@ -19,17 +19,10 @@
#include <QObject>
#include <QDateTime>
-#include "appsettings.h"
#include "inifile.h"
#include "libinstance_config.h"
-#define DEFINE_OVERRIDDEN_SETTING_ADVANCED(funcName, cfgEntryName, typeName) \
- typeName get ## funcName() const { return getField(cfgEntryName, settings->get ## funcName()).value<typeName>(); }
-
-#define DEFINE_OVERRIDDEN_SETTING(funcName, typeName) \
- DEFINE_OVERRIDDEN_SETTING_ADVANCED(funcName, STR_VAL(funcName), typeName)
-
class InstanceList;
/*!
@@ -40,7 +33,7 @@ class InstanceList;
* To create a new instance type, create a new class inheriting from this class
* and implement the pure virtual functions.
*/
-class LIBMMCINST_EXPORT Instance : public SettingsBase
+class LIBMMCINST_EXPORT Instance : public QObject
{
Q_OBJECT
public:
@@ -261,27 +254,6 @@ public:
//! Gets the path to the instance's modlist file.
QString modListFile() const;
- ////// Settings //////
-
- //// Java Settings ////
- DEFINE_OVERRIDDEN_SETTING_ADVANCED(JavaPath, JPATHKEY, QString)
- DEFINE_OVERRIDDEN_SETTING(JvmArgs, QString)
-
- //// Custom Commands ////
- DEFINE_OVERRIDDEN_SETTING(PreLaunchCommand, QString)
- DEFINE_OVERRIDDEN_SETTING(PostExitCommand, QString)
-
- //// Memory ////
- DEFINE_OVERRIDDEN_SETTING(MinMemAlloc, int)
- DEFINE_OVERRIDDEN_SETTING(MaxMemAlloc, int)
-
- //// Auto login ////
- DEFINE_OVERRIDDEN_SETTING(AutoLogin, bool)
-
- // This little guy here is to keep Qt Creator from being a dumbass and
- // auto-indenting the lines below the macros. Seriously, it's really annoying.
- ;
-
//////// OTHER FUNCTIONS ////////
@@ -327,12 +299,6 @@ protected:
*/
virtual void setField(const QString &name, QVariant val);
- // Overrides for SettingBase stuff.
- virtual QVariant getValue(const QString &name, QVariant defVal = QVariant()) const
- { return settings->getValue(name, defVal); }
- virtual void setValue(const QString &name, QVariant val)
- { setField(name, val); }
-
INIFile config;
private:
diff --git a/libinstance/src/instance.cpp b/libinstance/src/instance.cpp
index c79c0213..b505ec86 100644
--- a/libinstance/src/instance.cpp
+++ b/libinstance/src/instance.cpp
@@ -20,7 +20,7 @@
#include "pathutils.h"
Instance::Instance(const QString &rootDir, QObject *parent) :
- SettingsBase(parent)
+ QObject(parent)
{
m_rootDir = rootDir;
config.loadFile(PathCombine(rootDir, "instance.cfg"));