Cockatrice/cockatrice/src/settings/debug_settings.cpp
RickyRister fa79c5c36a
populate default debug.ini with more values (#5411)
* populate default debug.ini with more values

* move the default debug.ini to a resource
2025-01-03 20:50:30 +00:00

32 lines
No EOL
835 B
C++

#include "debug_settings.h"
#include <QtCore/QFile>
DebugSettings::DebugSettings(const QString &settingPath, QObject *parent)
: SettingsManager(settingPath + "debug.ini", 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", "debug").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();
}