creating log-object in main-function and commiting it to session
This commit is contained in:
@@ -46,14 +46,15 @@
|
||||
|
||||
using namespace std;
|
||||
|
||||
startWindowImpl::startWindowImpl(ConfigFile *c)
|
||||
: myConfig(c), msgBoxOutdatedVersionActive(false)
|
||||
startWindowImpl::startWindowImpl(ConfigFile *c, Log *l)
|
||||
: myConfig(c), myLog(l), msgBoxOutdatedVersionActive(false)
|
||||
{
|
||||
|
||||
myGuiInterface.reset(new GuiWrapper(myConfig, this));
|
||||
{
|
||||
mySession.reset(new Session(myGuiInterface.get(), myConfig));
|
||||
mySession.reset(new Session(myGuiInterface.get(), myConfig, myLog));
|
||||
mySession->init(); // TODO handle error
|
||||
myLog->init();
|
||||
// myGuiInterface->setSession(session);
|
||||
}
|
||||
|
||||
@@ -399,7 +400,8 @@ void startWindowImpl::callRejoinPossibleDialog(unsigned gameId)
|
||||
case QMessageBox::Yes:
|
||||
mySession->clientRejoinGame(gameId);
|
||||
break;
|
||||
case QMessageBox::No:;
|
||||
case QMessageBox::No:
|
||||
;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -419,7 +421,7 @@ void startWindowImpl::callCreateNetworkGameDialog()
|
||||
// Create pseudo Gui Wrapper for the server.
|
||||
myServerGuiInterface.reset(new ServerGuiWrapper(myConfig, mySession->getGui(), mySession->getGui(), mySession->getGui()));
|
||||
{
|
||||
boost::shared_ptr<Session> session(new Session(myServerGuiInterface.get(), myConfig));
|
||||
boost::shared_ptr<Session> session(new Session(myServerGuiInterface.get(), myConfig, 0));
|
||||
session->init(mySession->getAvatarManager());
|
||||
myServerGuiInterface->setSession(session);
|
||||
}
|
||||
|
||||
@@ -51,12 +51,13 @@ class timeoutMsgBoxImpl;
|
||||
class serverListDialogImpl;
|
||||
class internetGameLoginDialogImpl;
|
||||
class guiLog;
|
||||
class Log;
|
||||
|
||||
class startWindowImpl: public QMainWindow, public Ui::startWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
startWindowImpl(ConfigFile *c =0);
|
||||
startWindowImpl(ConfigFile *c, Log *l);
|
||||
~startWindowImpl();
|
||||
|
||||
void setSession(boost::shared_ptr<Session> session) {
|
||||
@@ -155,6 +156,7 @@ public slots:
|
||||
private:
|
||||
ConfigFile *myConfig;
|
||||
guiLog *myGuiLog;
|
||||
Log *myLog;
|
||||
|
||||
boost::shared_ptr<GuiInterface> myGuiInterface;
|
||||
boost::shared_ptr<Session> mySession;
|
||||
|
||||
Reference in New Issue
Block a user