-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathsettings.cpp
More file actions
105 lines (87 loc) · 2.34 KB
/
settings.cpp
File metadata and controls
105 lines (87 loc) · 2.34 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#include "settings.h"
#include <QCoreApplication>
#include <QDir>
Settings::Settings(QObject *parent) : QObject(parent)
{
settings = new QSettings(this);
}
QString Settings::mp3GainPath()
{
#ifdef Q_OS_WIN
QString appDir = QCoreApplication::applicationDirPath();
return settings->value("mp3gainPath", appDir + QDir::separator() + "mp3gain.exe").toString();
#else
return settings->value("mp3gainPath", "/usr/bin/mp3gain").toString();
#endif
}
void Settings::setMp3GainPath(QString path)
{
settings->setValue("mp3gainPath", path);
}
QString Settings::get7zipPath()
{
#ifdef Q_OS_WIN
QString appDir = QCoreApplication::applicationDirPath();
return settings->value("7zipPath", appDir + QDir::separator() + "7z.exe").toString();
#else
return settings->value("7zipPath", "/bin/7za").toString();
#endif
}
void Settings::set7zipPath(QString path)
{
settings->setValue("7zipPath", path);
}
QString Settings::ffmpegPath()
{
#ifdef Q_OS_WIN
QString appDir = QCoreApplication::applicationDirPath();
return settings->value("ffmpegPath", appDir + QDir::separator() + "ffmpeg" + QDir::separator() + "ffmpeg.exe").toString();
#else
return settings->value("ffmpegPath", "/usr/bin/ffmpeg").toString();
#endif
}
void Settings::setFfmpegPath(QString path)
{
settings->setValue("ffmpegPath", path);
}
bool Settings::forceReprocessing()
{
return settings->value("forceReprocessing", false).toBool();
}
void Settings::setForceReprocessing(bool enabled)
{
settings->setValue("forceReprocessing", enabled);
}
void Settings::setZipCompressionLevel(int level)
{
settings->setValue("zipCompressionLevel", level);
emit zipCompressionLevelChanged(level);
}
int Settings::zipCompressionLevel()
{
return settings->value("zipCompressionLevel", 9).toInt();
}
void Settings::setRemoveAfterZip(bool remove)
{
settings->setValue("removeAfterZip", remove);
}
void Settings::setRemoveAfterUnzip(bool remove)
{
settings->setValue("removeAfterUnzip", remove);
}
void Settings::setLastPath(QString path)
{
settings->setValue("lastPath", path);
}
bool Settings::removeAfterZip()
{
return settings->value("removeAfterZip", false).toBool();
}
bool Settings::removeAfterUnzip()
{
return settings->value("removeAfterUnzip", false).toBool();
}
QString Settings::lastPath()
{
return settings->value("lastPath", QString()).toString();
}