diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-01-11 00:03:05 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-01-11 00:51:29 +0300 |
commit | 05c3c78e18253d2a9faaebea16ee4ff0474db446 (patch) | |
tree | c043bcc95a2fa917cb4aedf0adb04d33e039a694 /src | |
parent | bb4b31241a30c16eba2506fff89b4057e4a7c6ee (diff) | |
download | manaplus-05c3c78e18253d2a9faaebea16ee4ff0474db446.tar.gz manaplus-05c3c78e18253d2a9faaebea16ee4ff0474db446.tar.bz2 manaplus-05c3c78e18253d2a9faaebea16ee4ff0474db446.tar.xz manaplus-05c3c78e18253d2a9faaebea16ee4ff0474db446.zip |
Fix compliation under gcc 4.7 snapshot.
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/chatwindow.cpp | 6 | ||||
-rw-r--r-- | src/gui/setup.cpp | 4 | ||||
-rw-r--r-- | src/gui/socialwindow.cpp | 4 | ||||
-rw-r--r-- | src/gui/widgets/tabbedarea.cpp | 10 | ||||
-rw-r--r-- | src/gui/widgets/tabbedarea.h | 8 |
5 files changed, 17 insertions, 15 deletions
diff --git a/src/gui/chatwindow.cpp b/src/gui/chatwindow.cpp index 0c094f7a8..a775510b0 100644 --- a/src/gui/chatwindow.cpp +++ b/src/gui/chatwindow.cpp @@ -420,11 +420,11 @@ void ChatWindow::prevTab() int tab = mChatTabs->getSelectedTabIndex(); - if (tab == 0) + if (tab <= 0) tab = mChatTabs->getNumberOfTabs(); tab--; - mChatTabs->setSelectedTab(tab); + mChatTabs->setSelectedTabByPos(tab); } void ChatWindow::nextTab() @@ -438,7 +438,7 @@ void ChatWindow::nextTab() if (tab == mChatTabs->getNumberOfTabs()) tab = 0; - mChatTabs->setSelectedTab(tab); + mChatTabs->setSelectedTabByPos(tab); } void ChatWindow::closeTab() diff --git a/src/gui/setup.cpp b/src/gui/setup.cpp index f76f738c6..bac474950 100644 --- a/src/gui/setup.cpp +++ b/src/gui/setup.cpp @@ -201,7 +201,7 @@ void Setup::doCancel() void Setup::activateTab(const std::string &name) { std::string tmp = gettext(name.c_str()); - mPanel->setSelectedTab(tmp); + mPanel->setSelectedTabByName(tmp); /* for (std::list<SetupTab*>::const_iterator it = mTabs.begin(); it != mTabs.end(); ++it) @@ -212,7 +212,7 @@ void Setup::activateTab(const std::string &name) logger->log("check tab: " + tab->getName()); if (tab->getName() == tmp) { - mPanel->setSelectedTab(name); + mPanel->setSelectedTabByName(name); return; } } diff --git a/src/gui/socialwindow.cpp b/src/gui/socialwindow.cpp index f5e293e5d..2d8ecc54f 100644 --- a/src/gui/socialwindow.cpp +++ b/src/gui/socialwindow.cpp @@ -1610,7 +1610,7 @@ void SocialWindow::nextTab() if (tab == mTabs->getNumberOfTabs()) tab = 0; - mTabs->setSelectedTab(tab); + mTabs->setSelectedTabByPos(tab); } void SocialWindow::prevTab() @@ -1624,7 +1624,7 @@ void SocialWindow::prevTab() tab = mTabs->getNumberOfTabs(); tab--; - mTabs->setSelectedTab(tab); + mTabs->setSelectedTabByPos(tab); } void SocialWindow::updateAttackFilter() diff --git a/src/gui/widgets/tabbedarea.cpp b/src/gui/widgets/tabbedarea.cpp index e7dda5067..9702d74f9 100644 --- a/src/gui/widgets/tabbedarea.cpp +++ b/src/gui/widgets/tabbedarea.cpp @@ -197,7 +197,7 @@ void TabbedArea::removeTab(gcn::Tab *tab) } else { - setSelectedTab(tabIndexToBeSelected); + setSelectedTabByPos(tabIndexToBeSelected); } adjustSize(); @@ -241,7 +241,7 @@ void TabbedArea::setSelectedTab(gcn::Tab *tab) widgetResized(nullptr); } -void TabbedArea::setSelectedTab(const std::string &name) +void TabbedArea::setSelectedTabByName(const std::string &name) { for (TabContainer::const_iterator itr = mTabs.begin(), itr_end = mTabs.end(); itr != itr_end; ++itr) @@ -254,6 +254,11 @@ void TabbedArea::setSelectedTab(const std::string &name) } } +void TabbedArea::setSelectedTabByPos(int tab) +{ + gcn::TabbedArea::setSelectedTab(tab); +} + void TabbedArea::widgetResized(const gcn::Event &event A_UNUSED) { int width = getWidth() - 2 * getFrameSize() @@ -460,7 +465,6 @@ void TabbedArea::removeAll() if (getSelectedTabIndex() != -1) { setSelectedTab(static_cast<unsigned int>(0)); - } while (getNumberOfTabs() > 0) { diff --git a/src/gui/widgets/tabbedarea.h b/src/gui/widgets/tabbedarea.h index 8e349a4b4..b202dfc9d 100644 --- a/src/gui/widgets/tabbedarea.h +++ b/src/gui/widgets/tabbedarea.h @@ -78,8 +78,6 @@ class TabbedArea : public gcn::TabbedArea, public gcn::WidgetListener */ gcn::Widget *getCurrentWidget(); - using gcn::TabbedArea::addTab; - /** * Add a tab. Overridden since it needs to size the widget. * @@ -112,11 +110,11 @@ class TabbedArea : public gcn::TabbedArea, public gcn::WidgetListener int getContainerHeight() const { return mWidgetContainer->getHeight(); } - using gcn::TabbedArea::setSelectedTab; - void setSelectedTab(gcn::Tab *tab); - void setSelectedTab(const std::string &name); + void setSelectedTabByPos(int tab); + + void setSelectedTabByName(const std::string &name); void widgetResized(const gcn::Event &event); |