summaryrefslogtreecommitdiff
path: root/src/profile.h
diff options
context:
space:
mode:
authorTannin <sherb@gmx.net>2016-05-07 00:22:23 +0200
committerTannin <sherb@gmx.net>2016-05-07 00:22:23 +0200
commite43762e7db5ec66c6fdc7a453b873b433a992e3d (patch)
tree3cbf579d100628b4e88fab7c22926423b2fc38b9 /src/profile.h
parentafe0d749c438b086a7efa08e4d443be94f56d101 (diff)
profiles can now be configured to use the global game settings instead of profile-local
Diffstat (limited to 'src/profile.h')
-rw-r--r--src/profile.h31
1 files changed, 26 insertions, 5 deletions
diff --git a/src/profile.h b/src/profile.h
index 87dd91a5..996e561f 100644
--- a/src/profile.h
+++ b/src/profile.h
@@ -29,6 +29,7 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
#include <QDir>
#include <QObject>
#include <QString>
+#include <QSettings>
#include <boost/shared_ptr.hpp>
@@ -112,20 +113,32 @@ public:
/**
* @return true if this profile uses local save games
*/
- bool localSavesEnabled() const;
+ virtual bool localSavesEnabled() const override;
/**
* @brief enables or disables the use of local save games for this profile
- * disabling this does not delete exising local saves but they will not be visible
- * in the game
+ * when disabling the user will be asked if he wants to remove the save games
+ * in the profile
* @param enable if true, local saves are enabled, otherewise they are disabled
*/
bool enableLocalSaves(bool enable);
/**
+ * @return true if this profile uses local ini files
+ */
+ virtual bool localSettingsEnabled() const override;
+
+ /**
+ * @brief enables or disables the use of local ini files for this profile
+ * disabling this does not delete existing ini files but the global ones will be used
+ * @param enable
+ */
+ bool enableLocalSettings(bool enable);
+
+ /**
* @return name of the profile (this is identical to its directory name)
**/
- QString name() const { return m_Directory.dirName(); }
+ virtual QString name() const override { return m_Directory.dirName(); }
/**
* @return the path of the plugins file in this profile
@@ -267,6 +280,12 @@ public:
void dumpModStatus() const;
+ QVariant setting(const QString &section, const QString &name,
+ const QVariant &fallback = QVariant());
+
+ void storeSetting(const QString &section, const QString &name,
+ const QVariant &value);
+
signals:
/**
@@ -311,7 +330,9 @@ private:
QDir m_Directory;
- MOBase::IPluginGame const * const m_GamePlugin;
+ QSettings *m_Settings;
+
+ const MOBase::IPluginGame *m_GamePlugin;
mutable QByteArray m_LastModlistHash;
std::vector<ModStatus> m_ModStatus;