summaryrefslogtreecommitdiff
path: root/src/settings.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/settings.h')
-rw-r--r--src/settings.h37
1 files changed, 32 insertions, 5 deletions
diff --git a/src/settings.h b/src/settings.h
index c8325ba2..689067d7 100644
--- a/src/settings.h
+++ b/src/settings.h
@@ -21,6 +21,7 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
#define SETTINGS_H
#include "loadmechanism.h"
+#include "envdump.h"
#include <filterwidget.h>
#include <lootcli/lootcli.h>
#include <questionboxmemory.h>
@@ -195,6 +196,10 @@ private:
class WidgetSettings
{
public:
+ // globalInstance is forwarded from the Settings constructor; WidgetSettings
+ // has the callbacks used by QuestionBoxMemory and those are global, so they
+ // should only be set by the global instance
+ //
WidgetSettings(QSettings& s, bool globalInstance);
// selected index for a combobox
@@ -647,13 +652,13 @@ public:
// crash dump type for both MO and usvfs
//
- CrashDumpsType crashDumpsType() const;
- void setCrashDumpsType(CrashDumpsType type);
+ env::CoreDumpTypes coreDumpType() const;
+ void setCoreDumpType(env::CoreDumpTypes type);
// maximum number of dump files keps, for both MO and usvfs
//
- int crashDumpsMax() const;
- void setCrashDumpsMax(int n);
+ int maxCoreDumps() const;
+ void setMaxCoreDumps(int n);
std::chrono::seconds spawnDelay() const;
void setSpawnDelay(std::chrono::seconds t);
@@ -671,10 +676,32 @@ class Settings : public QObject
Q_OBJECT;
public:
+ // there is one Settings global object for MO when an instance is loaded, but
+ // other Settings objects are required in several places, such as in the
+ // Instance class, the instance dialogs, etc.
+ //
+ // any Settings object created with globalInstance==false won't set the
+ // singleton
+ //
+ // only WidgetSettings need to know whether it created from a globalInstance,
+ // see its constructor
+ //
+ // @param path path to an ini file
+ // @param globalInsance whether this is the global instance; creates the
+ // singleton and asserts if it already exists
+ //
Settings(const QString& path, bool globalInstance=false);
~Settings();
- static Settings &instance();
+
+ // throws if there is no global Settings instance
+ //
+ static Settings& instance();
+
+ // returns null if there is no global Settings instance
+ //
+ static Settings* maybeInstance();
+
// name of the ini file
//