mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-30 18:43:55 -07:00
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:
parent
5df00de246
commit
f62e29f5d5
13 changed files with 161 additions and 83 deletions
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue