-
Notifications
You must be signed in to change notification settings - Fork 0
/
settingsprovider.cpp
40 lines (33 loc) · 1002 Bytes
/
settingsprovider.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
31
32
33
34
35
36
37
38
39
40
#include "settingsprovider.h"
#include <QDir>
#include <QFileInfo>
SettingsProvider::SettingsProvider(QSettings &settings)
{
this->settings = &settings;
}
QStringList SettingsProvider::userEntriesPaths() const
{
// TODO: make it configurable, but we stick with this for now.
QFileInfo fi(this->settings->fileName());
return {fi.absoluteDir().absolutePath()};
}
QStringList SettingsProvider::systemApplicationsEntriesPaths() const
{
return settings->value("sysAppsPaths", "/usr/share/applications/").toStringList();
}
int SettingsProvider::getMaxCols() const
{
return settings->value("maxColumns", 3).toInt();
}
bool SettingsProvider::singleInstanceMode() const
{
return settings->value("singleInstance", true).toBool();
}
QString SettingsProvider::getTerminalCommand() const
{
return settings->value("terminal", "/usr/bin/x-terminal-emulator -e %c").toString();
}
QString SettingsProvider::socketPath() const
{
return settings->value("singleInstanceSocket", "/tmp/qsrun").toString();
}