summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-07-04 03:07:26 +0300
committerAndrei Karas <akaras@inbox.ru>2011-07-04 03:41:46 +0300
commit4b2cb3433c82ba4ba28be8de82e0a49df7f3e388 (patch)
tree60f063d56d0aa316cfee4c1e1340b69cc992ede1 /src/gui
parentd5eb424dcd214b4646a960e04b9271e70b096856 (diff)
downloadmv-4b2cb3433c82ba4ba28be8de82e0a49df7f3e388.tar.gz
mv-4b2cb3433c82ba4ba28be8de82e0a49df7f3e388.tar.bz2
mv-4b2cb3433c82ba4ba28be8de82e0a49df7f3e388.tar.xz
mv-4b2cb3433c82ba4ba28be8de82e0a49df7f3e388.zip
Replace some lists to vectors.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/chatwindow.h2
-rw-r--r--src/gui/gui.cpp3
-rw-r--r--src/gui/ministatus.cpp6
-rw-r--r--src/gui/ministatus.h4
-rw-r--r--src/gui/popupmenu.cpp8
-rw-r--r--src/gui/windowmenu.cpp6
-rw-r--r--src/gui/windowmenu.h5
7 files changed, 18 insertions, 16 deletions
diff --git a/src/gui/chatwindow.h b/src/gui/chatwindow.h
index d68fa7671..0c43dcd8e 100644
--- a/src/gui/chatwindow.h
+++ b/src/gui/chatwindow.h
@@ -317,7 +317,7 @@ class ChatWindow : public Window,
bool mReturnToggles; /**< Marks whether <Return> toggles the chat log
or not */
- std::list<std::string> mTradeFilter;
+ std::vector<std::string> mTradeFilter;
gcn::DropDown *mColorPicker;
ColorListModel *mColorListModel;
diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp
index 05b168b5e..0bea1d0d7 100644
--- a/src/gui/gui.cpp
+++ b/src/gui/gui.cpp
@@ -419,7 +419,8 @@ void Gui::distributeMouseEvent(gcn::Widget* source, int type, int button,
(*it)->mouseClicked(mouseEvent);
break;
default:
- throw GCN_EXCEPTION("Unknown mouse event type.");
+ break;
+// throw GCN_EXCEPTION("Unknown mouse event type.");
}
}
diff --git a/src/gui/ministatus.cpp b/src/gui/ministatus.cpp
index 4c57812d5..feaf5e0ca 100644
--- a/src/gui/ministatus.cpp
+++ b/src/gui/ministatus.cpp
@@ -134,7 +134,7 @@ MiniStatusWindow::~MiniStatusWindow()
if (inv)
inv->removeInventoyListener(this);
- std::list <ProgressBar*>::iterator it, it_end;
+ std::vector <ProgressBar*>::iterator it, it_end;
for (it = mBars.begin(), it_end = mBars.end(); it != it_end; ++it)
{
ProgressBar *bar = *it;
@@ -160,7 +160,7 @@ ProgressBar *MiniStatusWindow::createBar(float progress, int width, int height,
void MiniStatusWindow::updateBars()
{
int x = 0;
- std::list <ProgressBar*>::iterator it, it_end;
+ std::vector <ProgressBar*>::iterator it, it_end;
ProgressBar* lastBar = 0;
for (it = mBars.begin(), it_end = mBars.end(); it != it_end; ++it)
safeRemove(*it);
@@ -439,7 +439,7 @@ void MiniStatusWindow::loadBars()
void MiniStatusWindow::saveBars()
{
- std::list <ProgressBar*>::iterator it, it_end;
+ std::vector <ProgressBar*>::iterator it, it_end;
int i = 0;
for (it = mBars.begin(), it_end = mBars.end();
it != it_end; ++it)
diff --git a/src/gui/ministatus.h b/src/gui/ministatus.h
index a2648d44b..0915ba8d4 100644
--- a/src/gui/ministatus.h
+++ b/src/gui/ministatus.h
@@ -88,7 +88,7 @@ class MiniStatusWindow : public Popup,
void slotsChanged(Inventory* inventory);
- std::list <ProgressBar*> &getBars()
+ std::vector <ProgressBar*> &getBars()
{ return mBars; }
private:
@@ -116,7 +116,7 @@ class MiniStatusWindow : public Popup,
ProgressBar *mStatusBar;
TextPopup *mTextPopup;
StatusPopup *mStatusPopup;
- std::list <ProgressBar*> mBars;
+ std::vector <ProgressBar*> mBars;
std::map <std::string, ProgressBar*> mBarNames;
std::vector<AnimatedSprite *> mIcons;
diff --git a/src/gui/popupmenu.cpp b/src/gui/popupmenu.cpp
index 33d0425e1..0ede3d122 100644
--- a/src/gui/popupmenu.cpp
+++ b/src/gui/popupmenu.cpp
@@ -1755,8 +1755,8 @@ void PopupMenu::showPopup(int x, int y, Button *button)
mButton = button;
mBrowserBox->clearRows();
- std::list <gcn::Button*> names = windowMenu->getButtons();
- std::list <gcn::Button*>::iterator it, it_end;
+ std::vector <gcn::Button*> names = windowMenu->getButtons();
+ std::vector <gcn::Button*>::iterator it, it_end;
for (it = names.begin(), it_end = names.end(); it != it_end; ++ it)
{
Button *btn = dynamic_cast<Button*>(*it);
@@ -1790,8 +1790,8 @@ void PopupMenu::showPopup(int x, int y, ProgressBar *b)
mNick = b->text();
mBrowserBox->clearRows();
- std::list <ProgressBar*> bars = miniStatusWindow->getBars();
- std::list <ProgressBar*>::iterator it, it_end;
+ std::vector <ProgressBar*> bars = miniStatusWindow->getBars();
+ std::vector <ProgressBar*>::iterator it, it_end;
for (it = bars.begin(), it_end = bars.end(); it != it_end; ++it)
{
ProgressBar *bar = *it;
diff --git a/src/gui/windowmenu.cpp b/src/gui/windowmenu.cpp
index c62ab9bba..e47888a3a 100644
--- a/src/gui/windowmenu.cpp
+++ b/src/gui/windowmenu.cpp
@@ -117,7 +117,7 @@ WindowMenu::~WindowMenu()
delete mTextPopup;
mTextPopup = 0;
mButtonNames.clear();
- std::list <gcn::Button*>::iterator it, it_end;
+ std::vector <gcn::Button*>::iterator it, it_end;
for (it = mButtons.begin(), it_end = mButtons.end(); it != it_end; ++it)
{
Button *btn = dynamic_cast<Button*>(*it);
@@ -329,7 +329,7 @@ void WindowMenu::showButton(std::string name, bool isVisible)
void WindowMenu::updateButtons()
{
int x = 0, h = 0;
- std::list <gcn::Button*>::iterator it, it_end;
+ std::vector <gcn::Button*>::iterator it, it_end;
for (it = mButtons.begin(), it_end = mButtons.end(); it != it_end; ++it)
safeRemove(*it);
for (it = mButtons.begin(), it_end = mButtons.end(); it != it_end; ++it)
@@ -372,7 +372,7 @@ void WindowMenu::loadButtons()
void WindowMenu::saveButtons()
{
- std::list <gcn::Button*>::iterator it, it_end;
+ std::vector <gcn::Button*>::iterator it, it_end;
int i = 0;
for (it = mButtons.begin(), it_end = mButtons.end();
it != it_end; ++it)
diff --git a/src/gui/windowmenu.h b/src/gui/windowmenu.h
index cebae7c11..503a8c1ad 100644
--- a/src/gui/windowmenu.h
+++ b/src/gui/windowmenu.h
@@ -30,6 +30,7 @@
#include <guichan/selectionlistener.hpp>
#include <map>
+#include <vector>
#ifdef __GNUC__
#define _UNUSED_ __attribute__ ((unused))
@@ -68,7 +69,7 @@ class WindowMenu : public Container,
std::map <std::string, gcn::Button*> &getButtonNames()
{ return mButtonNames; }
- std::list <gcn::Button*> &getButtons()
+ std::vector <gcn::Button*> &getButtons()
{ return mButtons; }
void showButton(std::string name, bool isVisible);
@@ -85,7 +86,7 @@ class WindowMenu : public Container,
EmotePopup *mEmotePopup;
TextPopup *mTextPopup;
- std::list <gcn::Button*> mButtons;
+ std::vector <gcn::Button*> mButtons;
std::map <std::string, gcn::Button*> mButtonNames;
};