From 13f7dddc670d628bf137e664d64696c7a4bac218 Mon Sep 17 00:00:00 2001 From: Fabio Bas Date: Tue, 1 Jul 2014 19:20:22 +0200 Subject: [PATCH 1/7] Removed unused variable --- cockatrice/src/main.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/cockatrice/src/main.cpp b/cockatrice/src/main.cpp index b7e2c0ea4..df38bbf64 100644 --- a/cockatrice/src/main.cpp +++ b/cockatrice/src/main.cpp @@ -136,7 +136,6 @@ int main(int argc, char *argv[]) qsrand(QDateTime::currentDateTime().toTime_t()); - bool startMainProgram = true; #if QT_VERSION < 0x050000 const QString dataDir = QDesktopServices::storageLocation(QDesktopServices::DataLocation); #else From 3db9c0a2570e055c5addc37ffb5b6f4069cbb1c8 Mon Sep 17 00:00:00 2001 From: Fabio Bas Date: Tue, 1 Jul 2014 19:40:14 +0200 Subject: [PATCH 2/7] Fix uninitialized variable --- cockatrice/src/gamesmodel.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/cockatrice/src/gamesmodel.cpp b/cockatrice/src/gamesmodel.cpp index 9dd7185d5..df0ec8809 100644 --- a/cockatrice/src/gamesmodel.cpp +++ b/cockatrice/src/gamesmodel.cpp @@ -93,6 +93,7 @@ GamesProxyModel::GamesProxyModel(QObject *parent, ServerInfo_User *_ownUser) : QSortFilterProxyModel(parent), ownUser(_ownUser), unavailableGamesVisible(false), + passwordProtectedGamesVisible(false), maxPlayersFilterMin(-1), maxPlayersFilterMax(-1) { From c416248e9bfd27fca372d5347d145390662b91c7 Mon Sep 17 00:00:00 2001 From: Fabio Bas Date: Tue, 1 Jul 2014 20:08:21 +0200 Subject: [PATCH 3/7] Fix uninitialized variable --- cockatrice/src/tab_game.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cockatrice/src/tab_game.cpp b/cockatrice/src/tab_game.cpp index b99fff020..f50f96b77 100644 --- a/cockatrice/src/tab_game.cpp +++ b/cockatrice/src/tab_game.cpp @@ -245,7 +245,8 @@ TabGame::TabGame(TabSupervisor *_tabSupervisor, GameReplay *_replay) activeCard(0), gameClosed(false), replay(_replay), - currentReplayStep(0) + currentReplayStep(0), + secondsElapsed(0) { setAttribute(Qt::WA_DeleteOnClose); From 9f6b5d489530abc0b32bb08ea55c921e4ec7db80 Mon Sep 17 00:00:00 2001 From: Fabio Bas Date: Tue, 1 Jul 2014 20:08:32 +0200 Subject: [PATCH 4/7] Fix uninitialized variable --- cockatrice/src/messagelogwidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cockatrice/src/messagelogwidget.cpp b/cockatrice/src/messagelogwidget.cpp index d40b10682..a25a3cd0c 100644 --- a/cockatrice/src/messagelogwidget.cpp +++ b/cockatrice/src/messagelogwidget.cpp @@ -876,6 +876,6 @@ void MessageLogWidget::connectToPlayer(Player *player) } MessageLogWidget::MessageLogWidget(const TabSupervisor *_tabSupervisor, TabGame *_game, QWidget *parent) - : ChatView(_tabSupervisor, _game, false, parent) + : ChatView(_tabSupervisor, _game, false, parent), currentContext(MessageContext_None) { } From 3a5cdd6ba805d2d74f007ff007503fc30f784cf2 Mon Sep 17 00:00:00 2001 From: Fabio Bas Date: Sat, 9 Aug 2014 12:09:37 +0200 Subject: [PATCH 5/7] Reorder class member variables initialization in TabGame --- cockatrice/src/tab_game.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cockatrice/src/tab_game.cpp b/cockatrice/src/tab_game.cpp index b6cab4a92..69d619258 100644 --- a/cockatrice/src/tab_game.cpp +++ b/cockatrice/src/tab_game.cpp @@ -236,6 +236,7 @@ void DeckViewContainer::setDeck(const DeckLoader &deck) TabGame::TabGame(TabSupervisor *_tabSupervisor, GameReplay *_replay) : Tab(_tabSupervisor), + secondsElapsed(0), hostId(-1), localPlayerId(-1), spectator(true), @@ -245,8 +246,7 @@ TabGame::TabGame(TabSupervisor *_tabSupervisor, GameReplay *_replay) activeCard(0), gameClosed(false), replay(_replay), - currentReplayStep(0), - secondsElapsed(0) + currentReplayStep(0) { setAttribute(Qt::WA_DeleteOnClose); From 83f57b096c5b72fcbf219987a051ca8880a7a577 Mon Sep 17 00:00:00 2001 From: Fabio Bas Date: Sat, 9 Aug 2014 12:27:44 +0200 Subject: [PATCH 6/7] Initialize symbolSize and ySpacing in PhasesToolbar they will be set to the right value later, but avoid using an uninitialized value when rearrangeButtons() is run for the first time --- cockatrice/src/phasestoolbar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cockatrice/src/phasestoolbar.cpp b/cockatrice/src/phasestoolbar.cpp index b34872f61..9b22f6118 100644 --- a/cockatrice/src/phasestoolbar.cpp +++ b/cockatrice/src/phasestoolbar.cpp @@ -100,7 +100,7 @@ void PhaseButton::triggerDoubleClickAction() } PhasesToolbar::PhasesToolbar(QGraphicsItem *parent) - : QGraphicsItem(parent), width(100), height(100) + : QGraphicsItem(parent), width(100), height(100), ySpacing(1), symbolSize(8) { QAction *aUntapAll = new QAction(this); connect(aUntapAll, SIGNAL(triggered()), this, SLOT(actUntapAll())); From 32f1f17d52ed0a8acdc5b18369d1a4f06506d994 Mon Sep 17 00:00:00 2001 From: Fabio Bas Date: Sat, 9 Aug 2014 12:41:12 +0200 Subject: [PATCH 7/7] Initialize privatePlayerId in GameEventStorage uninitialized in local games --- common/server_response_containers.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/server_response_containers.cpp b/common/server_response_containers.cpp index 0c95e5379..e327ee9df 100644 --- a/common/server_response_containers.cpp +++ b/common/server_response_containers.cpp @@ -15,7 +15,7 @@ GameEventStorageItem::~GameEventStorageItem() } GameEventStorage::GameEventStorage() - : gameEventContext(0) + : gameEventContext(0), privatePlayerId(0) { }