[LayoutSettings] Don't return by const value (#6592)

* [LayoutSettings] Don't return by const value

* fix compile failure
This commit is contained in:
RickyRister 2026-02-07 20:42:23 -08:00 committed by GitHub
parent 804a60f1ea
commit edc8691731
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 32 additions and 32 deletions

View file

@ -136,7 +136,7 @@ void TabDeckEditor::loadLayout()
{
LayoutsSettings &layouts = SettingsCache::instance().layouts();
auto &layoutState = layouts.getDeckEditorLayoutState();
auto layoutState = layouts.getDeckEditorLayoutState();
if (layoutState.isNull())
restartLayout();
else {

View file

@ -273,7 +273,7 @@ void TabDeckEditorVisual::refreshShortcuts()
void TabDeckEditorVisual::loadLayout()
{
LayoutsSettings &layouts = SettingsCache::instance().layouts();
auto &layoutState = layouts.getDeckEditorLayoutState();
auto layoutState = layouts.getDeckEditorLayoutState();
if (layoutState.isNull()) {
restartLayout();
} else {

View file

@ -27,7 +27,7 @@ QByteArray LayoutsSettings::getMainWindowGeometry()
return getValue(GEOMETRY_PROP, GROUP_MAIN_WINDOW).toByteArray();
}
const QByteArray LayoutsSettings::getDeckEditorLayoutState()
QByteArray LayoutsSettings::getDeckEditorLayoutState()
{
return getValue(STATE_PROP, GROUP_DECK_EDITOR).toByteArray();
}
@ -37,7 +37,7 @@ void LayoutsSettings::setDeckEditorLayoutState(const QByteArray &value)
setValue(value, STATE_PROP, GROUP_DECK_EDITOR);
}
const QByteArray LayoutsSettings::getDeckEditorGeometry()
QByteArray LayoutsSettings::getDeckEditorGeometry()
{
return getValue(GEOMETRY_PROP, GROUP_DECK_EDITOR).toByteArray();
}
@ -102,7 +102,7 @@ void LayoutsSettings::setDeckEditorFilterSize(const QSize &value)
setValue(value, "filter", GROUP_DECK_EDITOR, SIZE_PROP);
}
const QByteArray LayoutsSettings::getDeckEditorDbHeaderState()
QByteArray LayoutsSettings::getDeckEditorDbHeaderState()
{
return getValue(STATE_PROP, GROUP_DECK_EDITOR_DB, "header").toByteArray();
}
@ -112,7 +112,7 @@ void LayoutsSettings::setDeckEditorDbHeaderState(const QByteArray &value)
setValue(value, STATE_PROP, GROUP_DECK_EDITOR_DB, "header");
}
const QByteArray LayoutsSettings::getSetsDialogHeaderState()
QByteArray LayoutsSettings::getSetsDialogHeaderState()
{
return getValue(STATE_PROP, GROUP_SETS_DIALOG, "header").toByteArray();
}
@ -152,17 +152,17 @@ void LayoutsSettings::setGamePlayAreaState(const QByteArray &value)
setValue(value, STATE_PROP, GROUP_GAME_PLAY_AREA);
}
const QByteArray LayoutsSettings::getGamePlayAreaLayoutState()
QByteArray LayoutsSettings::getGamePlayAreaLayoutState()
{
return getValue(STATE_PROP, GROUP_GAME_PLAY_AREA).toByteArray();
}
const QByteArray LayoutsSettings::getGamePlayAreaGeometry()
QByteArray LayoutsSettings::getGamePlayAreaGeometry()
{
return getValue(GEOMETRY_PROP, GROUP_GAME_PLAY_AREA).toByteArray();
}
const QSize LayoutsSettings::getGameCardInfoSize()
QSize LayoutsSettings::getGameCardInfoSize()
{
QVariant previous = getValue("cardInfo", GROUP_GAME_PLAY_AREA, SIZE_PROP);
return previous == QVariant() ? QSize(250, 360) : previous.toSize();
@ -173,7 +173,7 @@ void LayoutsSettings::setGameCardInfoSize(const QSize &value)
setValue(value, "cardInfo", GROUP_GAME_PLAY_AREA, SIZE_PROP);
}
const QSize LayoutsSettings::getGameMessageLayoutSize()
QSize LayoutsSettings::getGameMessageLayoutSize()
{
QVariant previous = getValue("messageLayout", GROUP_GAME_PLAY_AREA, SIZE_PROP);
return previous == QVariant() ? QSize(250, 250) : previous.toSize();
@ -184,7 +184,7 @@ void LayoutsSettings::setGameMessageLayoutSize(const QSize &value)
setValue(value, "messageLayout", GROUP_GAME_PLAY_AREA, SIZE_PROP);
}
const QSize LayoutsSettings::getGamePlayerListSize()
QSize LayoutsSettings::getGamePlayerListSize()
{
QVariant previous = getValue("playerList", GROUP_GAME_PLAY_AREA, SIZE_PROP);
return previous == QVariant() ? QSize(250, 50) : previous.toSize();
@ -205,17 +205,17 @@ void LayoutsSettings::setReplayPlayAreaState(const QByteArray &value)
setValue(value, STATE_PROP, GROUP_REPLAY_PLAY_AREA);
}
const QByteArray LayoutsSettings::getReplayPlayAreaLayoutState()
QByteArray LayoutsSettings::getReplayPlayAreaLayoutState()
{
return getValue(STATE_PROP, GROUP_REPLAY_PLAY_AREA).toByteArray();
}
const QByteArray LayoutsSettings::getReplayPlayAreaGeometry()
QByteArray LayoutsSettings::getReplayPlayAreaGeometry()
{
return getValue(GEOMETRY_PROP, GROUP_REPLAY_PLAY_AREA).toByteArray();
}
const QSize LayoutsSettings::getReplayCardInfoSize()
QSize LayoutsSettings::getReplayCardInfoSize()
{
QVariant previous = getValue("cardInfo", GROUP_REPLAY_PLAY_AREA, SIZE_PROP);
return previous == QVariant() ? QSize(250, 360) : previous.toSize();
@ -226,7 +226,7 @@ void LayoutsSettings::setReplayCardInfoSize(const QSize &value)
setValue(value, "cardInfo", GROUP_REPLAY_PLAY_AREA, SIZE_PROP);
}
const QSize LayoutsSettings::getReplayMessageLayoutSize()
QSize LayoutsSettings::getReplayMessageLayoutSize()
{
QVariant previous = getValue("messageLayout", GROUP_REPLAY_PLAY_AREA, SIZE_PROP);
return previous == QVariant() ? QSize(250, 200) : previous.toSize();
@ -237,7 +237,7 @@ void LayoutsSettings::setReplayMessageLayoutSize(const QSize &value)
setValue(value, "messageLayout", GROUP_REPLAY_PLAY_AREA, SIZE_PROP);
}
const QSize LayoutsSettings::getReplayPlayerListSize()
QSize LayoutsSettings::getReplayPlayerListSize()
{
QVariant previous = getValue("playerList", GROUP_REPLAY_PLAY_AREA, SIZE_PROP);
return previous == QVariant() ? QSize(250, 50) : previous.toSize();
@ -248,7 +248,7 @@ void LayoutsSettings::setReplayPlayerListSize(const QSize &value)
setValue(value, "playerList", GROUP_REPLAY_PLAY_AREA, SIZE_PROP);
}
const QSize LayoutsSettings::getReplayReplaySize()
QSize LayoutsSettings::getReplayReplaySize()
{
QVariant previous = getValue("replay", GROUP_REPLAY_PLAY_AREA, SIZE_PROP);
return previous == QVariant() ? QSize(900, 100) : previous.toSize();

View file

@ -46,30 +46,30 @@ public:
QByteArray getMainWindowGeometry();
const QByteArray getDeckEditorLayoutState();
const QByteArray getDeckEditorGeometry();
QByteArray getDeckEditorLayoutState();
QByteArray getDeckEditorGeometry();
QSize getDeckEditorCardDatabaseSize();
QSize getDeckEditorCardSize();
QSize getDeckEditorDeckSize();
QSize getDeckEditorPrintingSelectorSize();
QSize getDeckEditorFilterSize();
const QByteArray getDeckEditorDbHeaderState();
const QByteArray getSetsDialogHeaderState();
QByteArray getDeckEditorDbHeaderState();
QByteArray getSetsDialogHeaderState();
QByteArray getSetsDialogGeometry();
QByteArray getTokenDialogGeometry();
const QByteArray getGamePlayAreaLayoutState();
const QByteArray getGamePlayAreaGeometry();
const QSize getGameCardInfoSize();
const QSize getGameMessageLayoutSize();
const QSize getGamePlayerListSize();
QByteArray getGamePlayAreaLayoutState();
QByteArray getGamePlayAreaGeometry();
QSize getGameCardInfoSize();
QSize getGameMessageLayoutSize();
QSize getGamePlayerListSize();
const QByteArray getReplayPlayAreaLayoutState();
const QByteArray getReplayPlayAreaGeometry();
const QSize getReplayCardInfoSize();
const QSize getReplayMessageLayoutSize();
const QSize getReplayPlayerListSize();
const QSize getReplayReplaySize();
QByteArray getReplayPlayAreaLayoutState();
QByteArray getReplayPlayAreaGeometry();
QSize getReplayCardInfoSize();
QSize getReplayMessageLayoutSize();
QSize getReplayPlayerListSize();
QSize getReplayReplaySize();
signals:
public slots: