summaryrefslogtreecommitdiffstats
path: root/libsettings/include
diff options
context:
space:
mode:
Diffstat (limited to 'libsettings/include')
-rw-r--r--libsettings/include/basicsettingsobject.h2
-rw-r--r--libsettings/include/inifile.h38
-rw-r--r--libsettings/include/inisettingsobject.h4
-rw-r--r--libsettings/include/libsettings_config.h6
-rw-r--r--libsettings/include/overridesetting.h2
-rw-r--r--libsettings/include/setting.h2
-rw-r--r--libsettings/include/settingsobject.h4
7 files changed, 48 insertions, 10 deletions
diff --git a/libsettings/include/basicsettingsobject.h b/libsettings/include/basicsettingsobject.h
index ec592b1e..b7e5851d 100644
--- a/libsettings/include/basicsettingsobject.h
+++ b/libsettings/include/basicsettingsobject.h
@@ -26,7 +26,7 @@
/*!
* \brief A settings object that stores its settings in a QSettings object.
*/
-class LIBMMCSETTINGS_EXPORT BasicSettingsObject : public SettingsObject
+class LIBSETTINGS_EXPORT BasicSettingsObject : public SettingsObject
{
Q_OBJECT
public:
diff --git a/libsettings/include/inifile.h b/libsettings/include/inifile.h
new file mode 100644
index 00000000..94467832
--- /dev/null
+++ b/libsettings/include/inifile.h
@@ -0,0 +1,38 @@
+/* Copyright 2013 MultiMC Contributors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef INIFILE_H
+#define INIFILE_H
+
+#include <QMap>
+#include <QString>
+#include <QVariant>
+
+#include "libsettings_config.h"
+
+// Sectionless INI parser (for instance config files)
+class LIBSETTINGS_EXPORT INIFile : public QMap<QString, QVariant>
+{
+public:
+ explicit INIFile();
+
+ bool loadFile(QString fileName);
+ bool saveFile(QString fileName);
+
+ QVariant get(QString key, QVariant def) const;
+ void set(QString key, QVariant val);
+};
+
+#endif // INIFILE_H
diff --git a/libsettings/include/inisettingsobject.h b/libsettings/include/inisettingsobject.h
index 6eead951..36c8e4bd 100644
--- a/libsettings/include/inisettingsobject.h
+++ b/libsettings/include/inisettingsobject.h
@@ -18,7 +18,7 @@
#include <QObject>
-#include <inifile.h>
+#include "inifile.h"
#include "settingsobject.h"
@@ -27,7 +27,7 @@
/*!
* \brief A settings object that stores its settings in an INIFile.
*/
-class LIBMMCSETTINGS_EXPORT INISettingsObject : public SettingsObject
+class LIBSETTINGS_EXPORT INISettingsObject : public SettingsObject
{
Q_OBJECT
public:
diff --git a/libsettings/include/libsettings_config.h b/libsettings/include/libsettings_config.h
index 05df5bfa..dc8e6228 100644
--- a/libsettings/include/libsettings_config.h
+++ b/libsettings/include/libsettings_config.h
@@ -18,10 +18,10 @@
#include <QtCore/QtGlobal>
-#ifdef LIBMMCSETTINGS_LIBRARY
-# define LIBMMCSETTINGS_EXPORT Q_DECL_EXPORT
+#ifdef LIBSETTINGS_LIBRARY
+# define LIBSETTINGS_EXPORT Q_DECL_EXPORT
#else
-# define LIBMMCSETTINGS_EXPORT Q_DECL_IMPORT
+# define LIBSETTINGS_EXPORT Q_DECL_IMPORT
#endif
#endif // LIBINSTANCE_CONFIG_H
diff --git a/libsettings/include/overridesetting.h b/libsettings/include/overridesetting.h
index e7bf2c32..58bb6d40 100644
--- a/libsettings/include/overridesetting.h
+++ b/libsettings/include/overridesetting.h
@@ -28,7 +28,7 @@
* The other setting can be (and usually is) a part of a different SettingsObject
* than this one.
*/
-class LIBMMCSETTINGS_EXPORT OverrideSetting : public Setting
+class LIBSETTINGS_EXPORT OverrideSetting : public Setting
{
Q_OBJECT
public:
diff --git a/libsettings/include/setting.h b/libsettings/include/setting.h
index 49185347..36709729 100644
--- a/libsettings/include/setting.h
+++ b/libsettings/include/setting.h
@@ -26,7 +26,7 @@ class SettingsObject;
/*!
*
*/
-class LIBMMCSETTINGS_EXPORT Setting : public QObject
+class LIBSETTINGS_EXPORT Setting : public QObject
{
Q_OBJECT
public:
diff --git a/libsettings/include/settingsobject.h b/libsettings/include/settingsobject.h
index f35d01b1..23f0d644 100644
--- a/libsettings/include/settingsobject.h
+++ b/libsettings/include/settingsobject.h
@@ -34,7 +34,7 @@ class Setting;
*
* \sa Setting
*/
-class LIBMMCSETTINGS_EXPORT SettingsObject : public QObject
+class LIBSETTINGS_EXPORT SettingsObject : public QObject
{
Q_OBJECT
public:
@@ -165,6 +165,6 @@ private:
/*!
* \brief A global settings object.
*/
-LIBMMCSETTINGS_EXPORT extern SettingsObject *globalSettings;
+LIBSETTINGS_EXPORT extern SettingsObject *globalSettings;
#endif // SETTINGSOBJECT_H