From bd7190f03c272624de44b0d785074bf052524f1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20Br=C3=BCbach?= Date: Sun, 6 Sep 2026 12:43:02 +0200 Subject: [PATCH] [Game] Move formatElapsedTime helper out of public slots (#2202) The message log needs the HH:MM:SS formatter used by the game timer, but it lives in GameState's public slots, tying a pure formatting helper to the signal-slot machinery. Move formatElapsedTime into a public section of GameState so the log can call it directly, and add the missing trailing newline to game_state.cpp. --- cockatrice/src/game/game_state.cpp | 2 +- cockatrice/src/game/game_state.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/cockatrice/src/game/game_state.cpp b/cockatrice/src/game/game_state.cpp index 30cb1acd4..dc9ba02a3 100644 --- a/cockatrice/src/game/game_state.cpp +++ b/cockatrice/src/game/game_state.cpp @@ -42,4 +42,4 @@ QString GameState::formatElapsedTime(int _secondsElapsed) return QString::number(hours).rightJustified(2, '0') + ":" + QString::number(minutes).rightJustified(2, '0') + ":" + QString::number(seconds).rightJustified(2, '0'); -} \ No newline at end of file +} diff --git a/cockatrice/src/game/game_state.h b/cockatrice/src/game/game_state.h index eb93edce3..94bbb853c 100644 --- a/cockatrice/src/game/game_state.h +++ b/cockatrice/src/game/game_state.h @@ -125,6 +125,8 @@ signals: public slots: void incrementGameTime(); void setGameTime(int _secondsElapsed); + +public: static QString formatElapsedTime(int _secondsElapsed); private: