session boost_ptr refactoring
This commit is contained in:
@@ -19,7 +19,7 @@
|
||||
#include <net/socket_msg.h>
|
||||
|
||||
gameLobbyDialogImpl::gameLobbyDialogImpl(startWindowImpl *parent, ConfigFile *c)
|
||||
: QDialog(parent), myW(NULL), myStartWindow(parent), myConfig(c), mySession(NULL), currentGameName(""), myPlayerId(0), isAdmin(false), inGame(false), myChat(NULL), keyUpCounter(0)
|
||||
: QDialog(parent), myW(NULL), myStartWindow(parent), myConfig(c), currentGameName(""), myPlayerId(0), isAdmin(false), inGame(false), myChat(NULL), keyUpCounter(0)
|
||||
{
|
||||
|
||||
#ifdef __APPLE__
|
||||
@@ -87,11 +87,6 @@ gameLobbyDialogImpl::~gameLobbyDialogImpl()
|
||||
|
||||
}
|
||||
|
||||
void gameLobbyDialogImpl::setSession(Session *session)
|
||||
{
|
||||
mySession = session;
|
||||
}
|
||||
|
||||
void gameLobbyDialogImpl::createGame()
|
||||
{
|
||||
assert(mySession);
|
||||
|
||||
@@ -43,8 +43,8 @@ public:
|
||||
|
||||
LobbyChat *getLobbyChat() { return myChat; }
|
||||
|
||||
void setSession(Session *session);
|
||||
Session& getSession() { return *mySession; }
|
||||
void setSession(boost::shared_ptr<Session> session) { mySession = session; }
|
||||
boost::shared_ptr<Session> getSession() { assert(mySession.get()); return mySession; }
|
||||
|
||||
void setMyW ( gameTableImpl* theValue ) { myW = theValue; }
|
||||
|
||||
@@ -110,7 +110,7 @@ private:
|
||||
gameTableImpl* myW;
|
||||
startWindowImpl* myStartWindow;
|
||||
ConfigFile *myConfig;
|
||||
Session *mySession;
|
||||
boost::shared_ptr<Session> mySession;
|
||||
createInternetGameDialogImpl *myCreateInternetGameDialog;
|
||||
QString currentGameName;
|
||||
unsigned myPlayerId;
|
||||
|
||||
@@ -48,7 +48,7 @@ void LobbyChat::sendMessage() {
|
||||
QString tmpMsg(myLobby->lineEdit_ChatInput->text());
|
||||
if (tmpMsg.size())
|
||||
{
|
||||
myLobby->getSession().sendIrcChatMessage(tmpMsg.toUtf8().constData());
|
||||
myLobby->getSession()->sendIrcChatMessage(tmpMsg.toUtf8().constData());
|
||||
myLobby->lineEdit_ChatInput->setText("");
|
||||
|
||||
displayMessage(myNick, tmpMsg);
|
||||
|
||||
Reference in New Issue
Block a user