Cockatrice/libcockatrice_settings/libcockatrice/settings/debug_settings.cpp
BruebachL f62e29f5d5
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>
2025-11-15 15:58:25 +01:00

32 lines
846 B
C++

#include "debug_settings.h"
#include <QtCore/QFile>
DebugSettings::DebugSettings(const QString &settingPath, QObject *parent)
: SettingsManager(settingPath + "debug.ini", "debug", QString(), parent)
{
// Create the default debug.ini if it doesn't exist yet
if (!QFile(settingPath + "debug.ini").exists()) {
QFile::copy(":/resources/config/debug.ini", settingPath + "debug.ini");
}
}
bool DebugSettings::getShowCardId()
{
return getValue("showCardId").toBool();
}
bool DebugSettings::getLocalGameOnStartup()
{
return getValue("onStartup", "localgame").toBool();
}
int DebugSettings::getLocalGamePlayerCount()
{
return getValue("playerCount", "localgame").toInt();
}
QString DebugSettings::getDeckPathForPlayer(const QString &playerName)
{
return getValue(playerName, "localgame", "deck").toString();
}