diff --git a/src/gui/generic/serverguiwrapper.h b/src/gui/generic/serverguiwrapper.h index e7833d99..20bebe8a 100644 --- a/src/gui/generic/serverguiwrapper.h +++ b/src/gui/generic/serverguiwrapper.h @@ -36,7 +36,7 @@ public: Session &getSession(); void setSession(boost::shared_ptr session); - gameTableImpl* getMyW() const{}; + gameTableImpl* getMyW() const {return NULL;} void refreshSet() const; void refreshCash() const; diff --git a/src/gui/qt/startwindow/startwindowimpl.cpp b/src/gui/qt/startwindow/startwindowimpl.cpp index f1d1dc23..bcaf6e0b 100644 --- a/src/gui/qt/startwindow/startwindowimpl.cpp +++ b/src/gui/qt/startwindow/startwindowimpl.cpp @@ -45,10 +45,10 @@ #include "lobbychat.h" startWindowImpl::startWindowImpl(ConfigFile *c) - : myW(NULL), myConfig(c) + : myConfig(c) { - boost::shared_ptr myGuiInterface(new GuiWrapper(myConfig, this)); + myGuiInterface.reset(new GuiWrapper(myConfig, this)); { boost::shared_ptr session(new Session(myGuiInterface.get(), myConfig)); session->init(); // TODO handle error @@ -141,10 +141,10 @@ void startWindowImpl::callNewGameDialog() { if(myConfig->readConfigInt("ShowGameSettingsDialogOnNewGame")){ myNewGameDialog->exec(); - if (myNewGameDialog->result() == QDialog::Accepted ) { myW->startNewLocalGame(myNewGameDialog); } + if (myNewGameDialog->result() == QDialog::Accepted ) { myGuiInterface->getMyW()->startNewLocalGame(myNewGameDialog); } } // sonst mit gespeicherten Werten starten - else { myW->startNewLocalGame(); } + else { myGuiInterface->getMyW()->startNewLocalGame(); } } void startWindowImpl::callGameLobbyDialog() { @@ -166,7 +166,7 @@ void startWindowImpl::callGameLobbyDialog() { void startWindowImpl::joinGameLobby() { // Stop local game. - myW->stopTimer(); + myGuiInterface->getMyW()->stopTimer(); // Join Lobby mySession->terminateNetworkClient(); @@ -229,7 +229,7 @@ void startWindowImpl::callCreateNetworkGameDialog() { if (myCreateNetworkGameDialog->result() == QDialog::Accepted ) { // Stop local game. - myW->stopTimer(); + myGuiInterface->getMyW()->stopTimer(); if (!myServerGuiInterface) { @@ -311,7 +311,7 @@ void startWindowImpl::callJoinNetworkGameDialog() { if (myJoinNetworkGameDialog->result() == QDialog::Accepted ) { // Stop local game. - myW->stopTimer(); + myGuiInterface->getMyW()->stopTimer(); mySession->terminateNetworkClient(); if (myServerGuiInterface) @@ -368,7 +368,7 @@ void startWindowImpl::showLobbyDialog() if (myGameLobbyDialog->result() == QDialog::Accepted) { //some gui modifications - myW->networkGameModification(); + myGuiInterface->getMyW()->networkGameModification(); } else { @@ -383,7 +383,7 @@ void startWindowImpl::showNetworkStartDialog() if (myStartNetworkGameDialog->result() == QDialog::Accepted ) { //some gui modifications - myW->networkGameModification(); + myGuiInterface->getMyW()->networkGameModification(); } else { mySession->terminateNetworkClient(); diff --git a/src/gui/qt/startwindow/startwindowimpl.h b/src/gui/qt/startwindow/startwindowimpl.h index 7a5a5013..45060ce7 100644 --- a/src/gui/qt/startwindow/startwindowimpl.h +++ b/src/gui/qt/startwindow/startwindowimpl.h @@ -99,9 +99,9 @@ public slots: void showNetworkStartDialog(); private: - gameTableImpl *myW; ConfigFile *myConfig; + boost::shared_ptr myGuiInterface; boost::shared_ptr mySession; boost::shared_ptr myServerGuiInterface;