summaryrefslogtreecommitdiffstats
path: root/core/settings/qPrefGeneral.cpp
blob: 25ed835f0703826f11a3ab3d1bb20b0c937db896 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// SPDX-License-Identifier: GPL-2.0
#include "qPrefGeneral.h"
#include "qPrefPrivate.h"


static const QString group = QStringLiteral("GeneralSettings");

QString qPrefGeneral::st_diveshareExport_uid;
static const QString st_diveshareExport_uid_default;

bool qPrefGeneral::st_diveshareExport_private;
static const bool st_diveshareExport_private_default = false;

qPrefGeneral *qPrefGeneral::instance()
{
	static qPrefGeneral *self = new qPrefGeneral;
	return self;
}


void qPrefGeneral::loadSync(bool doSync)
{
	disk_defaultsetpoint(doSync);
	disk_o2consumption(doSync);
	disk_pscr_ratio(doSync);
	disk_filterFullTextNotes(doSync);
	disk_filterCaseSensitive(doSync);

	if (!doSync) {
		load_diveshareExport_uid();
		load_diveshareExport_private();
	}
}

HANDLE_PREFERENCE_INT(General, "defaultsetpoint", defaultsetpoint);

HANDLE_PREFERENCE_INT(General, "o2consumption", o2consumption);

HANDLE_PREFERENCE_INT(General, "pscr_ratio", pscr_ratio);

HANDLE_PROP_QSTRING(General, "diveshareExport/uid", diveshareExport_uid);

HANDLE_PROP_BOOL(General, "diveshareExport/private", diveshareExport_private);

HANDLE_PREFERENCE_BOOL(General, "filterFullTextNotes", filterFullTextNotes);

HANDLE_PREFERENCE_BOOL(General, "filterCaseSensitive", filterCaseSensitive);