mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-13 17:44:48 -07:00
Clang script (#3085)
This commit is contained in:
parent
fcfb2b12b7
commit
35159ef61a
24 changed files with 2098 additions and 2054 deletions
|
|
@ -1,8 +1,8 @@
|
|||
#include "carddatabasesettings.h"
|
||||
|
||||
CardDatabaseSettings::CardDatabaseSettings(QString settingPath, QObject *parent) : SettingsManager(settingPath+"cardDatabase.ini", parent)
|
||||
CardDatabaseSettings::CardDatabaseSettings(QString settingPath, QObject *parent)
|
||||
: SettingsManager(settingPath + "cardDatabase.ini", parent)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void CardDatabaseSettings::setSortKey(QString shortName, unsigned int sortKey)
|
||||
|
|
|
|||
|
|
@ -4,14 +4,15 @@
|
|||
#include "settingsmanager.h"
|
||||
|
||||
#include <QObject>
|
||||
#include <QVariant>
|
||||
#include <QSettings>
|
||||
#include <QVariant>
|
||||
|
||||
class CardDatabaseSettings : public SettingsManager
|
||||
{
|
||||
Q_OBJECT
|
||||
friend class SettingsCache;
|
||||
public:
|
||||
|
||||
public:
|
||||
void setSortKey(QString shortName, unsigned int sortKey);
|
||||
void setEnabled(QString shortName, bool enabled);
|
||||
void setIsKnown(QString shortName, bool isknown);
|
||||
|
|
@ -25,7 +26,7 @@ public slots:
|
|||
|
||||
private:
|
||||
explicit CardDatabaseSettings(QString settingPath, QObject *parent = nullptr);
|
||||
CardDatabaseSettings( const CardDatabaseSettings& /*other*/ );
|
||||
CardDatabaseSettings(const CardDatabaseSettings & /*other*/);
|
||||
};
|
||||
|
||||
#endif // CARDDATABASESETTINGS_H
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
#include <QCryptographicHash>
|
||||
|
||||
GameFiltersSettings::GameFiltersSettings(QString settingPath, QObject *parent)
|
||||
: SettingsManager(settingPath+"gamefilters.ini", parent)
|
||||
: SettingsManager(settingPath + "gamefilters.ini", parent)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -28,72 +28,70 @@ bool GameFiltersSettings::isShowBuddiesOnlyGames()
|
|||
|
||||
void GameFiltersSettings::setUnavailableGamesVisible(bool enabled)
|
||||
{
|
||||
setValue(enabled, "unavailable_games_visible","filter_games");
|
||||
setValue(enabled, "unavailable_games_visible", "filter_games");
|
||||
}
|
||||
|
||||
bool GameFiltersSettings::isUnavailableGamesVisible()
|
||||
{
|
||||
QVariant previous = getValue("unavailable_games_visible","filter_games");
|
||||
QVariant previous = getValue("unavailable_games_visible", "filter_games");
|
||||
return previous == QVariant() ? false : previous.toBool();
|
||||
}
|
||||
|
||||
void GameFiltersSettings::setShowPasswordProtectedGames(bool show)
|
||||
{
|
||||
setValue(show, "show_password_protected_games","filter_games");
|
||||
setValue(show, "show_password_protected_games", "filter_games");
|
||||
}
|
||||
|
||||
bool GameFiltersSettings::isShowPasswordProtectedGames()
|
||||
{
|
||||
QVariant previous = getValue("show_password_protected_games","filter_games");
|
||||
QVariant previous = getValue("show_password_protected_games", "filter_games");
|
||||
return previous == QVariant() ? true : previous.toBool();
|
||||
}
|
||||
|
||||
void GameFiltersSettings::setGameNameFilter(QString gameName)
|
||||
{
|
||||
setValue(gameName, "game_name_filter","filter_games");
|
||||
setValue(gameName, "game_name_filter", "filter_games");
|
||||
}
|
||||
|
||||
QString GameFiltersSettings::getGameNameFilter()
|
||||
{
|
||||
return getValue("game_name_filter","filter_games").toString();
|
||||
return getValue("game_name_filter", "filter_games").toString();
|
||||
}
|
||||
|
||||
void GameFiltersSettings::setMinPlayers(int min)
|
||||
{
|
||||
setValue(min, "min_players","filter_games");
|
||||
setValue(min, "min_players", "filter_games");
|
||||
}
|
||||
|
||||
int GameFiltersSettings::getMinPlayers()
|
||||
{
|
||||
QVariant previous = getValue("min_players","filter_games");
|
||||
QVariant previous = getValue("min_players", "filter_games");
|
||||
return previous == QVariant() ? 1 : previous.toInt();
|
||||
}
|
||||
|
||||
void GameFiltersSettings::setMaxPlayers(int max)
|
||||
{
|
||||
setValue(max, "max_players","filter_games");
|
||||
setValue(max, "max_players", "filter_games");
|
||||
}
|
||||
|
||||
int GameFiltersSettings::getMaxPlayers()
|
||||
{
|
||||
QVariant previous = getValue("max_players","filter_games");
|
||||
QVariant previous = getValue("max_players", "filter_games");
|
||||
return previous == QVariant() ? 99 : previous.toInt();
|
||||
}
|
||||
|
||||
void GameFiltersSettings::setGameTypeEnabled(QString gametype, bool enabled)
|
||||
{
|
||||
setValue(enabled, "game_type/"+hashGameType(gametype),"filter_games");
|
||||
setValue(enabled, "game_type/" + hashGameType(gametype), "filter_games");
|
||||
}
|
||||
|
||||
void GameFiltersSettings::setGameHashedTypeEnabled(QString gametypeHASHED, bool enabled)
|
||||
{
|
||||
setValue(enabled, gametypeHASHED,"filter_games");
|
||||
setValue(enabled, gametypeHASHED, "filter_games");
|
||||
}
|
||||
|
||||
bool GameFiltersSettings::isGameTypeEnabled(QString gametype)
|
||||
{
|
||||
QVariant previous = getValue("game_type/"+hashGameType(gametype),"filter_games");
|
||||
QVariant previous = getValue("game_type/" + hashGameType(gametype), "filter_games");
|
||||
return previous == QVariant() ? false : previous.toBool();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ class GameFiltersSettings : public SettingsManager
|
|||
{
|
||||
Q_OBJECT
|
||||
friend class SettingsCache;
|
||||
|
||||
public:
|
||||
bool isShowBuddiesOnlyGames();
|
||||
bool isUnavailableGamesVisible();
|
||||
|
|
@ -29,8 +30,8 @@ signals:
|
|||
public slots:
|
||||
|
||||
private:
|
||||
explicit GameFiltersSettings(QString settingPath,QObject *parent = nullptr);
|
||||
GameFiltersSettings( const GameFiltersSettings& /*other*/ );
|
||||
explicit GameFiltersSettings(QString settingPath, QObject *parent = nullptr);
|
||||
GameFiltersSettings(const GameFiltersSettings & /*other*/);
|
||||
|
||||
QString hashGameType(const QString &gameType) const;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#include "layoutssettings.h"
|
||||
|
||||
LayoutsSettings::LayoutsSettings(QString settingPath, QObject *parent)
|
||||
: SettingsManager(settingPath+"layouts.ini", parent)
|
||||
: SettingsManager(settingPath + "layouts.ini", parent)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -12,7 +12,7 @@ const QByteArray LayoutsSettings::getDeckEditorLayoutState()
|
|||
|
||||
void LayoutsSettings::setDeckEditorLayoutState(const QByteArray &value)
|
||||
{
|
||||
setValue(value,"layouts/deckEditor_state");
|
||||
setValue(value, "layouts/deckEditor_state");
|
||||
}
|
||||
|
||||
const QByteArray LayoutsSettings::getDeckEditorGeometry()
|
||||
|
|
@ -22,40 +22,40 @@ const QByteArray LayoutsSettings::getDeckEditorGeometry()
|
|||
|
||||
void LayoutsSettings::setDeckEditorGeometry(const QByteArray &value)
|
||||
{
|
||||
setValue(value,"layouts/deckEditor_geometry");
|
||||
setValue(value, "layouts/deckEditor_geometry");
|
||||
}
|
||||
|
||||
const QSize LayoutsSettings::getDeckEditorCardSize()
|
||||
{
|
||||
QVariant previous = getValue("layouts/deckEditor_CardSize");
|
||||
return previous == QVariant() ? QSize(250,500) : previous.toSize();
|
||||
return previous == QVariant() ? QSize(250, 500) : previous.toSize();
|
||||
}
|
||||
|
||||
void LayoutsSettings::setDeckEditorCardSize(const QSize &value)
|
||||
{
|
||||
setValue(value,"layouts/deckEditor_CardSize");
|
||||
setValue(value, "layouts/deckEditor_CardSize");
|
||||
}
|
||||
|
||||
const QSize LayoutsSettings::getDeckEditorDeckSize()
|
||||
{
|
||||
QVariant previous = getValue("layouts/deckEditor_DeckSize");
|
||||
return previous == QVariant() ? QSize(250,360) : previous.toSize();
|
||||
return previous == QVariant() ? QSize(250, 360) : previous.toSize();
|
||||
}
|
||||
|
||||
void LayoutsSettings::setDeckEditorDeckSize(const QSize &value)
|
||||
{
|
||||
setValue(value,"layouts/deckEditor_DeckSize");
|
||||
setValue(value, "layouts/deckEditor_DeckSize");
|
||||
}
|
||||
|
||||
const QSize LayoutsSettings::getDeckEditorFilterSize()
|
||||
{
|
||||
QVariant previous = getValue("layouts/deckEditor_FilterSize");
|
||||
return previous == QVariant() ? QSize(250,250) : previous.toSize();
|
||||
return previous == QVariant() ? QSize(250, 250) : previous.toSize();
|
||||
}
|
||||
|
||||
void LayoutsSettings::setDeckEditorFilterSize(const QSize &value)
|
||||
{
|
||||
setValue(value,"layouts/deckEditor_FilterSize");
|
||||
setValue(value, "layouts/deckEditor_FilterSize");
|
||||
}
|
||||
|
||||
const QByteArray LayoutsSettings::getDeckEditorDbHeaderState()
|
||||
|
|
@ -65,17 +65,17 @@ const QByteArray LayoutsSettings::getDeckEditorDbHeaderState()
|
|||
|
||||
void LayoutsSettings::setDeckEditorDbHeaderState(const QByteArray &value)
|
||||
{
|
||||
setValue(value,"layouts/deckEditorDbHeader_state");
|
||||
setValue(value, "layouts/deckEditorDbHeader_state");
|
||||
}
|
||||
|
||||
void LayoutsSettings::setGamePlayAreaGeometry(const QByteArray &value)
|
||||
{
|
||||
setValue(value,"layouts/gameplayarea_geometry");
|
||||
setValue(value, "layouts/gameplayarea_geometry");
|
||||
}
|
||||
|
||||
void LayoutsSettings::setGamePlayAreaState(const QByteArray &value)
|
||||
{
|
||||
setValue(value,"layouts/gameplayarea_state");
|
||||
setValue(value, "layouts/gameplayarea_state");
|
||||
}
|
||||
|
||||
const QByteArray LayoutsSettings::getGamePlayAreaLayoutState()
|
||||
|
|
@ -91,44 +91,44 @@ const QByteArray LayoutsSettings::getGamePlayAreaGeometry()
|
|||
const QSize LayoutsSettings::getGameCardInfoSize()
|
||||
{
|
||||
QVariant previous = getValue("layouts/gameplayarea_CardInfoSize");
|
||||
return previous == QVariant() ? QSize(250,360) : previous.toSize();
|
||||
return previous == QVariant() ? QSize(250, 360) : previous.toSize();
|
||||
}
|
||||
|
||||
void LayoutsSettings::setGameCardInfoSize(const QSize &value)
|
||||
{
|
||||
setValue(value,"layouts/gameplayarea_CardInfoSize");
|
||||
setValue(value, "layouts/gameplayarea_CardInfoSize");
|
||||
}
|
||||
|
||||
const QSize LayoutsSettings::getGameMessageLayoutSize()
|
||||
{
|
||||
QVariant previous = getValue("layouts/gameplayarea_MessageLayoutSize");
|
||||
return previous == QVariant() ? QSize(250,250) : previous.toSize();
|
||||
return previous == QVariant() ? QSize(250, 250) : previous.toSize();
|
||||
}
|
||||
|
||||
void LayoutsSettings::setGameMessageLayoutSize(const QSize &value)
|
||||
{
|
||||
setValue(value,"layouts/gameplayarea_MessageLayoutSize");
|
||||
setValue(value, "layouts/gameplayarea_MessageLayoutSize");
|
||||
}
|
||||
|
||||
const QSize LayoutsSettings::getGamePlayerListSize()
|
||||
{
|
||||
QVariant previous = getValue("layouts/gameplayarea_PlayerListSize");
|
||||
return previous == QVariant() ? QSize(250,50) : previous.toSize();
|
||||
return previous == QVariant() ? QSize(250, 50) : previous.toSize();
|
||||
}
|
||||
|
||||
void LayoutsSettings::setGamePlayerListSize(const QSize &value)
|
||||
{
|
||||
setValue(value,"layouts/gameplayarea_PlayerListSize");
|
||||
setValue(value, "layouts/gameplayarea_PlayerListSize");
|
||||
}
|
||||
|
||||
void LayoutsSettings::setReplayPlayAreaGeometry(const QByteArray &value)
|
||||
{
|
||||
setValue(value,"layouts/replayplayarea_geometry");
|
||||
setValue(value, "layouts/replayplayarea_geometry");
|
||||
}
|
||||
|
||||
void LayoutsSettings::setReplayPlayAreaState(const QByteArray &value)
|
||||
{
|
||||
setValue(value,"layouts/replayplayarea_state");
|
||||
setValue(value, "layouts/replayplayarea_state");
|
||||
}
|
||||
|
||||
const QByteArray LayoutsSettings::getReplayPlayAreaLayoutState()
|
||||
|
|
@ -144,43 +144,43 @@ const QByteArray LayoutsSettings::getReplayPlayAreaGeometry()
|
|||
const QSize LayoutsSettings::getReplayCardInfoSize()
|
||||
{
|
||||
QVariant previous = getValue("layouts/replayplayarea_CardInfoSize");
|
||||
return previous == QVariant() ? QSize(250,360) : previous.toSize();
|
||||
return previous == QVariant() ? QSize(250, 360) : previous.toSize();
|
||||
}
|
||||
|
||||
void LayoutsSettings::setReplayCardInfoSize(const QSize &value)
|
||||
{
|
||||
setValue(value,"layouts/replayplayarea_CardInfoSize");
|
||||
setValue(value, "layouts/replayplayarea_CardInfoSize");
|
||||
}
|
||||
|
||||
const QSize LayoutsSettings::getReplayMessageLayoutSize()
|
||||
{
|
||||
QVariant previous = getValue("layouts/replayplayarea_MessageLayoutSize");
|
||||
return previous == QVariant() ? QSize(250,200) : previous.toSize();
|
||||
return previous == QVariant() ? QSize(250, 200) : previous.toSize();
|
||||
}
|
||||
|
||||
void LayoutsSettings::setReplayMessageLayoutSize(const QSize &value)
|
||||
{
|
||||
setValue(value,"layouts/replayplayarea_MessageLayoutSize");
|
||||
setValue(value, "layouts/replayplayarea_MessageLayoutSize");
|
||||
}
|
||||
|
||||
const QSize LayoutsSettings::getReplayPlayerListSize()
|
||||
{
|
||||
QVariant previous = getValue("layouts/replayplayarea_PlayerListSize");
|
||||
return previous == QVariant() ? QSize(250,50) : previous.toSize();
|
||||
return previous == QVariant() ? QSize(250, 50) : previous.toSize();
|
||||
}
|
||||
|
||||
void LayoutsSettings::setReplayPlayerListSize(const QSize &value)
|
||||
{
|
||||
setValue(value,"layouts/replayplayarea_PlayerListSize");
|
||||
setValue(value, "layouts/replayplayarea_PlayerListSize");
|
||||
}
|
||||
|
||||
const QSize LayoutsSettings::getReplayReplaySize()
|
||||
{
|
||||
QVariant previous = getValue("layouts/replayplayarea_ReplaySize");
|
||||
return previous == QVariant() ? QSize(900,100) : previous.toSize();
|
||||
return previous == QVariant() ? QSize(900, 100) : previous.toSize();
|
||||
}
|
||||
|
||||
void LayoutsSettings::setReplayReplaySize(const QSize &value)
|
||||
{
|
||||
setValue(value,"layouts/replayplayarea_ReplaySize");
|
||||
setValue(value, "layouts/replayplayarea_ReplaySize");
|
||||
}
|
||||
|
|
@ -8,6 +8,7 @@ class LayoutsSettings : public SettingsManager
|
|||
{
|
||||
Q_OBJECT
|
||||
friend class SettingsCache;
|
||||
|
||||
public:
|
||||
void setDeckEditorLayoutState(const QByteArray &value);
|
||||
void setDeckEditorGeometry(const QByteArray &value);
|
||||
|
|
@ -53,8 +54,8 @@ signals:
|
|||
public slots:
|
||||
|
||||
private:
|
||||
explicit LayoutsSettings(QString settingPath,QObject *parent = nullptr);
|
||||
LayoutsSettings( const LayoutsSettings& /*other*/ );
|
||||
explicit LayoutsSettings(QString settingPath, QObject *parent = nullptr);
|
||||
LayoutsSettings(const LayoutsSettings & /*other*/);
|
||||
};
|
||||
|
||||
#endif // LAYOUTSSETTINGS_H
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
#include "messagesettings.h"
|
||||
|
||||
MessageSettings::MessageSettings(QString settingPath, QObject *parent)
|
||||
: SettingsManager(settingPath+"messages.ini",parent)
|
||||
: SettingsManager(settingPath + "messages.ini", parent)
|
||||
{
|
||||
}
|
||||
|
||||
QString MessageSettings::getMessageAt(int index)
|
||||
{
|
||||
return getValue(QString("msg%1").arg(index),"messages").toString();
|
||||
return getValue(QString("msg%1").arg(index), "messages").toString();
|
||||
}
|
||||
|
||||
int MessageSettings::getCount()
|
||||
|
|
@ -17,10 +17,10 @@ int MessageSettings::getCount()
|
|||
|
||||
void MessageSettings::setCount(int count)
|
||||
{
|
||||
setValue(count,"count","messages");
|
||||
setValue(count, "count", "messages");
|
||||
}
|
||||
|
||||
void MessageSettings::setMessageAt(int index, QString message)
|
||||
{
|
||||
setValue(message,QString("msg%1").arg(index),"messages");
|
||||
setValue(message, QString("msg%1").arg(index), "messages");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ public slots:
|
|||
|
||||
private:
|
||||
explicit MessageSettings(QString settingPath, QObject *parent = nullptr);
|
||||
MessageSettings( const MessageSettings& /*other*/ );
|
||||
MessageSettings(const MessageSettings & /*other*/);
|
||||
};
|
||||
|
||||
#endif // MESSAGESETTINGS_H
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
#include <QDebug>
|
||||
|
||||
ServersSettings::ServersSettings(QString settingPath, QObject *parent)
|
||||
: SettingsManager(settingPath+"servers.ini", parent)
|
||||
: SettingsManager(settingPath + "servers.ini", parent)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -175,7 +175,12 @@ bool ServersSettings::getClearDebugLogStatus(bool abDefaultValue)
|
|||
return cbFlushLog == QVariant() ? abDefaultValue : cbFlushLog.toBool();
|
||||
}
|
||||
|
||||
void ServersSettings::addNewServer(QString saveName, QString serv, QString port, QString username, QString password, bool savePassword)
|
||||
void ServersSettings::addNewServer(QString saveName,
|
||||
QString serv,
|
||||
QString port,
|
||||
QString username,
|
||||
QString password,
|
||||
bool savePassword)
|
||||
{
|
||||
if (updateExistingServer(saveName, serv, port, username, password, savePassword))
|
||||
return;
|
||||
|
|
@ -189,17 +194,19 @@ void ServersSettings::addNewServer(QString saveName, QString serv, QString port,
|
|||
setValue(savePassword, QString("savePassword%1").arg(index), "server", "server_details");
|
||||
setValue(index, "totalServers", "server", "server_details");
|
||||
setValue(password, QString("password%1").arg(index), "server", "server_details");
|
||||
|
||||
}
|
||||
|
||||
bool ServersSettings::updateExistingServer(QString saveName, QString serv, QString port, QString username, QString password, bool savePassword)
|
||||
bool ServersSettings::updateExistingServer(QString saveName,
|
||||
QString serv,
|
||||
QString port,
|
||||
QString username,
|
||||
QString password,
|
||||
bool savePassword)
|
||||
{
|
||||
int size = getValue("totalServers", "server", "server_details").toInt() + 1;
|
||||
|
||||
for (int i = 0; i < size; i++)
|
||||
{
|
||||
if (saveName == getValue(QString("saveName%1").arg(i), "server", "server_details").toString())
|
||||
{
|
||||
for (int i = 0; i < size; i++) {
|
||||
if (saveName == getValue(QString("saveName%1").arg(i), "server", "server_details").toString()) {
|
||||
setValue(serv, QString("server%1").arg(i), "server", "server_details");
|
||||
setValue(port, QString("port%1").arg(i), "server", "server_details");
|
||||
setValue(username, QString("username%1").arg(i), "server", "server_details");
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ class ServersSettings : public SettingsManager
|
|||
Q_OBJECT
|
||||
friend class SettingsCache;
|
||||
|
||||
public:
|
||||
public:
|
||||
int getPreviousHostLogin();
|
||||
int getPrevioushostindex(const QString &);
|
||||
QStringList getPreviousHostList();
|
||||
|
|
@ -37,8 +37,14 @@ public:
|
|||
void setFPPort(QString port);
|
||||
void setSavePassword(int save);
|
||||
void setFPPlayerName(QString playerName);
|
||||
void addNewServer(QString saveName, QString serv, QString port, QString username, QString password, bool savePassword);
|
||||
bool updateExistingServer(QString saveName, QString serv, QString port, QString username, QString password, bool savePassword);
|
||||
void
|
||||
addNewServer(QString saveName, QString serv, QString port, QString username, QString password, bool savePassword);
|
||||
bool updateExistingServer(QString saveName,
|
||||
QString serv,
|
||||
QString port,
|
||||
QString username,
|
||||
QString password,
|
||||
bool savePassword);
|
||||
void setClearDebugLogStatus(bool abIsChecked);
|
||||
bool getClearDebugLogStatus(bool abDefaultValue);
|
||||
|
||||
|
|
@ -47,8 +53,8 @@ signals:
|
|||
public slots:
|
||||
|
||||
private:
|
||||
explicit ServersSettings(QString settingPath,QObject *parent = nullptr);
|
||||
ServersSettings( const ServersSettings& /*other*/ );
|
||||
explicit ServersSettings(QString settingPath, QObject *parent = nullptr);
|
||||
ServersSettings(const ServersSettings & /*other*/);
|
||||
};
|
||||
|
||||
#endif // SERVERSSETTINGS_H
|
||||
|
|
|
|||
|
|
@ -1,56 +1,48 @@
|
|||
#include "settingsmanager.h"
|
||||
|
||||
SettingsManager::SettingsManager(QString settingPath, QObject *parent) : QObject(parent), settings(settingPath, QSettings::IniFormat)
|
||||
SettingsManager::SettingsManager(QString settingPath, QObject *parent)
|
||||
: QObject(parent), settings(settingPath, QSettings::IniFormat)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void SettingsManager::setValue(QVariant value, QString name, QString group, QString subGroup)
|
||||
{
|
||||
if (!group.isEmpty())
|
||||
{
|
||||
if (!group.isEmpty()) {
|
||||
settings.beginGroup(group);
|
||||
}
|
||||
|
||||
if (!subGroup.isEmpty())
|
||||
{
|
||||
if (!subGroup.isEmpty()) {
|
||||
settings.beginGroup(subGroup);
|
||||
}
|
||||
|
||||
settings.setValue(name, value);
|
||||
|
||||
if (!subGroup.isEmpty())
|
||||
{
|
||||
if (!subGroup.isEmpty()) {
|
||||
settings.endGroup();
|
||||
}
|
||||
|
||||
if (!group.isEmpty())
|
||||
{
|
||||
if (!group.isEmpty()) {
|
||||
settings.endGroup();
|
||||
}
|
||||
}
|
||||
|
||||
QVariant SettingsManager::getValue(QString name, QString group, QString subGroup)
|
||||
{
|
||||
if (!group.isEmpty())
|
||||
{
|
||||
if (!group.isEmpty()) {
|
||||
settings.beginGroup(group);
|
||||
}
|
||||
|
||||
if (!subGroup.isEmpty())
|
||||
{
|
||||
if (!subGroup.isEmpty()) {
|
||||
settings.beginGroup(subGroup);
|
||||
}
|
||||
|
||||
QVariant value = settings.value(name);
|
||||
|
||||
if (!subGroup.isEmpty())
|
||||
{
|
||||
if (!subGroup.isEmpty()) {
|
||||
settings.endGroup();
|
||||
}
|
||||
|
||||
if (!group.isEmpty())
|
||||
{
|
||||
if (!group.isEmpty()) {
|
||||
settings.endGroup();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue