forked from REDasmOrg/REDasm
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathredasmsettings.cpp
More file actions
23 lines (18 loc) · 1.01 KB
/
redasmsettings.cpp
File metadata and controls
23 lines (18 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include "redasmsettings.h"
REDasmSettings::REDasmSettings(QObject *parent) : QSettings(parent) { }
bool REDasmSettings::hasGeometry() const { return this->contains("geometry"); }
QStringList REDasmSettings::recentFiles() const { return this->value("recent_files").toStringList(); }
void REDasmSettings::updateRecentFiles(const QString &s)
{
QStringList recents = this->recentFiles();
recents.removeAll(s); // Remove duplicates
recents.prepend(s);
while(recents.length() > MAX_RECENT_FILES)
recents.removeLast();
this->setValue("recent_files", recents);
}
QByteArray REDasmSettings::geometry() const { return this->value("geometry").toByteArray(); }
void REDasmSettings::changeGeometry(const QByteArray &ba) { this->setValue("geometry", ba); }
bool REDasmSettings::isDarkTheme() const { return this->value("theme") == Theme::Dark; }
int REDasmSettings::currentTheme() const { return this->value("theme", 0).toInt(); }
void REDasmSettings::changeTheme(int theme) { this->setValue("theme", theme); }