From 32014de9008efe051a1a8b05e5e976a4629b34d2 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 30 Jun 2011 23:14:59 +0300 Subject: Replace some lists to vectors. --- src/gui/popupmenu.cpp | 4 ++-- src/gui/popupmenu.h | 2 +- src/gui/socialwindow.cpp | 4 ++-- src/gui/viewport.cpp | 2 +- src/gui/widgets/browserbox.h | 2 +- src/gui/widgets/vertcontainer.cpp | 2 +- src/gui/widgets/vertcontainer.h | 4 +++- src/gui/widgets/windowcontainer.h | 4 +++- 8 files changed, 14 insertions(+), 10 deletions(-) (limited to 'src/gui') diff --git a/src/gui/popupmenu.cpp b/src/gui/popupmenu.cpp index 89dd64c18..12669415d 100644 --- a/src/gui/popupmenu.cpp +++ b/src/gui/popupmenu.cpp @@ -317,11 +317,11 @@ void PopupMenu::showPopup(int x, int y, Being *being) showPopup(x, y); } -void PopupMenu::showPopup(int x, int y, std::list &beings) +void PopupMenu::showPopup(int x, int y, std::vector &beings) { mBrowserBox->clearRows(); mBrowserBox->addRow("Players"); - std::list::iterator it, it_end; + std::vector::iterator it, it_end; for (it = beings.begin(), it_end = beings.end(); it != it_end; ++it) { Being *being = *it; diff --git a/src/gui/popupmenu.h b/src/gui/popupmenu.h index 50d86ff37..8830bdd00 100644 --- a/src/gui/popupmenu.h +++ b/src/gui/popupmenu.h @@ -102,7 +102,7 @@ class PopupMenu : public Popup, public LinkHandler /** * Shows the beings related popup menu at the specified mouse coords. */ - void showPopup(int x, int y, std::list &beings); + void showPopup(int x, int y, std::vector &beings); void showPlayerPopup(int x, int y, std::string nick); diff --git a/src/gui/socialwindow.cpp b/src/gui/socialwindow.cpp index de9bab42b..fcb33542b 100644 --- a/src/gui/socialwindow.cpp +++ b/src/gui/socialwindow.cpp @@ -553,9 +553,9 @@ public: return; std::vector *avatars = mBeings->getMembers(); - std::list portals = map->getPortals(); + std::vector portals = map->getPortals(); - std::list::iterator i = portals.begin(); + std::vector::iterator i = portals.begin(); SpecialLayer *specialLayer = map->getSpecialLayer(); std::vector::iterator ia = avatars->begin(); diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp index 0fc7444ec..d2c0db7b1 100644 --- a/src/gui/viewport.cpp +++ b/src/gui/viewport.cpp @@ -404,7 +404,7 @@ void Viewport::mousePressed(gcn::MouseEvent &event) { if (actorSpriteManager) { - std::list beings; + std::vector beings; const int x = getMouseX() + static_cast(mPixelViewX); const int y = getMouseY() + static_cast(mPixelViewY); actorSpriteManager->findBeingsByPixel(beings, x, y, true); diff --git a/src/gui/widgets/browserbox.h b/src/gui/widgets/browserbox.h index 258e0bd09..2bdf31237 100644 --- a/src/gui/widgets/browserbox.h +++ b/src/gui/widgets/browserbox.h @@ -200,7 +200,7 @@ class BrowserBox : public gcn::Widget, typedef TextRows::iterator TextRowIterator; TextRows mTextRows; - typedef std::list LinePartList; + typedef std::vector LinePartList; typedef LinePartList::iterator LinePartIterator; LinePartList mLineParts; diff --git a/src/gui/widgets/vertcontainer.cpp b/src/gui/widgets/vertcontainer.cpp index 6f94df535..9920c7210 100644 --- a/src/gui/widgets/vertcontainer.cpp +++ b/src/gui/widgets/vertcontainer.cpp @@ -73,7 +73,7 @@ void VertContainer::clear() void VertContainer::widgetResized(const gcn::Event &event _UNUSED_) { - for (WidgetListIterator it = mResizableWidgets.begin(); + for (std::vector::iterator it = mResizableWidgets.begin(); it != mResizableWidgets.end(); it++) { (*it)->setWidth(getWidth()); diff --git a/src/gui/widgets/vertcontainer.h b/src/gui/widgets/vertcontainer.h index 268c61d4f..cccd772b8 100644 --- a/src/gui/widgets/vertcontainer.h +++ b/src/gui/widgets/vertcontainer.h @@ -26,6 +26,8 @@ #include +#include + #ifdef __GNUC__ #define _UNUSED_ __attribute__ ((unused)) #else @@ -53,7 +55,7 @@ class VertContainer : public Container, public gcn::WidgetListener void widgetResized(const gcn::Event &event); private: - std::list mResizableWidgets; + std::vector mResizableWidgets; int mVerticalItemSize; int mCount; int mNextY; diff --git a/src/gui/widgets/windowcontainer.h b/src/gui/widgets/windowcontainer.h index 757f7ab5a..b27ba927f 100644 --- a/src/gui/widgets/windowcontainer.h +++ b/src/gui/widgets/windowcontainer.h @@ -25,6 +25,8 @@ #include "gui/widgets/container.h" +#include + /** * A window container. This container adds functionality for more convenient * widget (windows in particular) destruction. @@ -50,7 +52,7 @@ class WindowContainer : public Container /** * List of widgets that are scheduled to be deleted. */ - typedef std::list Widgets; + typedef std::vector Widgets; typedef Widgets::iterator WidgetIterator; Widgets mDeathList; }; -- cgit v1.2.3-70-g09d2