summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-10-18 23:47:50 +0300
committerAndrei Karas <akaras@inbox.ru>2013-10-19 15:12:22 +0300
commitc5ca3e7f6571cb96f05a9ba2aa7ed3c0dbd06bf9 (patch)
tree3bbfedf220a5982498e28e926aa233289492b81d /src
parent7044b7af7742d44115a6450b17982fe7c455882e (diff)
downloadplus-c5ca3e7f6571cb96f05a9ba2aa7ed3c0dbd06bf9.tar.gz
plus-c5ca3e7f6571cb96f05a9ba2aa7ed3c0dbd06bf9.tar.bz2
plus-c5ca3e7f6571cb96f05a9ba2aa7ed3c0dbd06bf9.tar.xz
plus-c5ca3e7f6571cb96f05a9ba2aa7ed3c0dbd06bf9.zip
move virtual member calls from socialwindow constuctor into postInit.
also remove virtual method calls from tab classes.
Diffstat (limited to 'src')
-rw-r--r--src/game.cpp1
-rw-r--r--src/gui/windows/socialwindow.cpp17
-rw-r--r--src/gui/windows/socialwindow.h2
3 files changed, 15 insertions, 5 deletions
diff --git a/src/game.cpp b/src/game.cpp
index a54bfd670..d9b4cd271 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -263,6 +263,7 @@ static void createGuiWindows()
whoIsOnline = new WhoIsOnline;
killStats = new KillStats;
socialWindow = new SocialWindow;
+ socialWindow->postInit();
if (serverVersion >= 6)
questsWindow = new QuestsWindow;
diff --git a/src/gui/windows/socialwindow.cpp b/src/gui/windows/socialwindow.cpp
index 74b01ef27..49cba826f 100644
--- a/src/gui/windows/socialwindow.cpp
+++ b/src/gui/windows/socialwindow.cpp
@@ -547,7 +547,7 @@ public:
mScroll->setHorizontalScrollPolicy(gcn::ScrollArea::SHOW_AUTO);
mScroll->setVerticalScrollPolicy(gcn::ScrollArea::SHOW_ALWAYS);
- updateList();
+ getPlayersAvatars();
setCaption(name);
}
@@ -881,7 +881,7 @@ public:
const Map *const map = socialWindow->getMap();
if (!map)
- return 01;
+ return -1;
std::vector<Avatar*>::const_iterator i = avatars->begin();
const std::vector<Avatar*>::const_iterator i_end = avatars->end();
@@ -1021,7 +1021,7 @@ private:
++ ia;\
}\
avatars->clear();\
- Avatar *ava;\
+ Avatar *ava = nullptr;\
std::list<std::string> mobs;\
std::list<std::string>::const_iterator i;\
std::list<std::string>::const_iterator i_end;
@@ -1135,7 +1135,7 @@ public:
mScroll->setHorizontalScrollPolicy(gcn::ScrollArea::SHOW_AUTO);
mScroll->setVerticalScrollPolicy(gcn::ScrollArea::SHOW_ALWAYS);
- updateList();
+ getPlayersAvatars();
setCaption(name);
}
@@ -1227,9 +1227,11 @@ public:
mBrowserBox->addRow("##3---");
// TRANSLATORS: party popup item
mBrowserBox->addRow(strprintf("@@cancel|%s@@", _("Cancel")));
+ }
+ void postInit()
+ {
add(mBrowserBox);
-
setContentSize(mBrowserBox->getWidth() + 8,
mBrowserBox->getHeight() + 8);
}
@@ -1304,6 +1306,11 @@ SocialWindow::SocialWindow() :
mNeedUpdate(false),
mProcessedPortals(false)
{
+ mCreatePopup->postInit();
+}
+
+void SocialWindow::postInit()
+{
setWindowName("Social");
setVisible(false);
setSaveVisible(true);
diff --git a/src/gui/windows/socialwindow.h b/src/gui/windows/socialwindow.h
index c1833cd0a..28b139589 100644
--- a/src/gui/windows/socialwindow.h
+++ b/src/gui/windows/socialwindow.h
@@ -54,6 +54,8 @@ public:
~SocialWindow();
+ void postInit();
+
bool addTab(Guild *const guild);
bool removeTab(Guild *const guild);