Give settings managers default groups instead of manually specifying them everywhere. (#6273)

* Give settings managers default groups instead of manually specifying them everywhere.

Took 1 hour 2 minutes


Took 41 seconds

Took 32 seconds

Took 5 minutes

* Fix dbconverter mock.

Took 2 minutes

---------

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
BruebachL 2025-11-15 15:58:25 +01:00 committed by GitHub
parent 5df00de246
commit f62e29f5d5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 161 additions and 83 deletions

View file

@ -3,22 +3,22 @@
#define MAX_RECENT_DECK_COUNT 10
RecentsSettings::RecentsSettings(const QString &settingPath, QObject *parent)
: SettingsManager(settingPath + "recents.ini", parent)
: SettingsManager(settingPath + "recents.ini", "deckbuilder", QString(), parent)
{
}
QStringList RecentsSettings::getRecentlyOpenedDeckPaths()
{
return getValue("deckpaths", "deckbuilder").toStringList();
return getValue("deckpaths").toStringList();
}
void RecentsSettings::clearRecentlyOpenedDeckPaths()
{
deleteValue("deckpaths", "deckbuilder");
deleteValue("deckpaths");
emit recentlyOpenedDeckPathsChanged();
}
void RecentsSettings::updateRecentlyOpenedDeckPaths(const QString &deckPath)
{
auto deckPaths = getValue("deckpaths", "deckbuilder").toStringList();
auto deckPaths = getValue("deckpaths").toStringList();
deckPaths.removeAll(deckPath);
deckPaths.prepend(deckPath);
@ -27,7 +27,7 @@ void RecentsSettings::updateRecentlyOpenedDeckPaths(const QString &deckPath)
deckPaths.removeLast();
}
setValue(deckPaths, "deckpaths", "deckbuilder");
setValue(deckPaths, "deckpaths");
emit recentlyOpenedDeckPathsChanged();
}