-
Notifications
You must be signed in to change notification settings - Fork 0
/
settings.cpp
30 lines (25 loc) · 874 Bytes
/
settings.cpp
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
#include "settings.h"
const QString Settings::ORGANIZATION = "Brandon Jessup";
const QString Settings::APPLICATION = "Tag";
void Settings::saveThumbnailSliderPosition(const int& value)
{
QSettings settings(ORGANIZATION, APPLICATION);
settings.setValue("thumbnailSlider", value);
}
int Settings::loadThumbnailSliderPosition()
{
QSettings settings(ORGANIZATION, APPLICATION);
const int DEFAULT_VALUE = 100;
return settings.value("thumbnailSlider", DEFAULT_VALUE).toInt();
}
void Settings::saveLastUsedDirectory(const QString& path)
{
QSettings settings(ORGANIZATION, APPLICATION);
settings.setValue("lastUsedDirectory", path);
}
QString Settings::loadLastUsedDirectory()
{
QSettings settings(ORGANIZATION, APPLICATION);
const QString DEFAULT_VALUE = "/home";
return settings.value("lastUsedDirectory", DEFAULT_VALUE).toString();
}