From e33ff37c820030ab2661dd70e84a7151fbee9ef1 Mon Sep 17 00:00:00 2001 From: Zach H Date: Fri, 29 Nov 2024 22:36:38 -0800 Subject: [PATCH] Pass QTime objects instead of references (#5209) - References seem to go to 0 in newer Qt versions(?) https://doc.qt.io/qt-6/qtime.html > QTime objects should be passed by value rather than by reference to const; they simply package int. --- cockatrice/src/dialogs/dlg_filter_games.cpp | 2 +- cockatrice/src/dialogs/dlg_filter_games.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cockatrice/src/dialogs/dlg_filter_games.cpp b/cockatrice/src/dialogs/dlg_filter_games.cpp index 6b99d0046..f988c5a49 100644 --- a/cockatrice/src/dialogs/dlg_filter_games.cpp +++ b/cockatrice/src/dialogs/dlg_filter_games.cpp @@ -276,7 +276,7 @@ int DlgFilterGames::getMaxPlayersFilterMax() const return maxPlayersFilterMaxSpinBox->value(); } -const QTime &DlgFilterGames::getMaxGameAge() const +QTime DlgFilterGames::getMaxGameAge() const { int index = maxGameAgeComboBox->currentIndex(); if (index < 0 || index >= gameAgeMap.size()) { // index is out of bounds diff --git a/cockatrice/src/dialogs/dlg_filter_games.h b/cockatrice/src/dialogs/dlg_filter_games.h index 0b1fd333c..77e5cbb2e 100644 --- a/cockatrice/src/dialogs/dlg_filter_games.h +++ b/cockatrice/src/dialogs/dlg_filter_games.h @@ -67,7 +67,7 @@ public: int getMaxPlayersFilterMin() const; int getMaxPlayersFilterMax() const; void setMaxPlayersFilter(int _maxPlayersFilterMin, int _maxPlayersFilterMax); - const QTime &getMaxGameAge() const; + QTime getMaxGameAge() const; const QMap gameAgeMap; bool getShowOnlyIfSpectatorsCanWatch() const; bool getShowSpectatorPasswordProtected() const;