summaryrefslogtreecommitdiff
path: root/src/gui/ministatuswindow.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-01-20 19:01:23 +0300
committerAndrei Karas <akaras@inbox.ru>2013-01-20 19:29:26 +0300
commit531433248fbad49e2b8e9d90de9855f3ea9b2257 (patch)
tree33937a65d8b18934879824fa4c2a6183d53d5e73 /src/gui/ministatuswindow.cpp
parent48071e171de41a23197c7328ba038331a936e0eb (diff)
downloadmv-531433248fbad49e2b8e9d90de9855f3ea9b2257.tar.gz
mv-531433248fbad49e2b8e9d90de9855f3ea9b2257.tar.bz2
mv-531433248fbad49e2b8e9d90de9855f3ea9b2257.tar.xz
mv-531433248fbad49e2b8e9d90de9855f3ea9b2257.zip
Another part with FOR_EACH changes.
Diffstat (limited to 'src/gui/ministatuswindow.cpp')
-rw-r--r--src/gui/ministatuswindow.cpp17
1 files changed, 7 insertions, 10 deletions
diff --git a/src/gui/ministatuswindow.cpp b/src/gui/ministatuswindow.cpp
index b1c6eba24..5e4559c9c 100644
--- a/src/gui/ministatuswindow.cpp
+++ b/src/gui/ministatuswindow.cpp
@@ -48,6 +48,8 @@
extern volatile int tick_time;
+typedef std::vector <ProgressBar*>::const_iterator ProgressBarVectorCIter;
+
MiniStatusWindow::MiniStatusWindow() :
Popup("MiniStatus", "ministatus.xml"),
InventoryListener(),
@@ -124,8 +126,7 @@ MiniStatusWindow::~MiniStatusWindow()
if (inv)
inv->removeInventoyListener(this);
- for (std::vector <ProgressBar*>::const_iterator it = mBars.begin(),
- it_end = mBars.end(); it != it_end; ++it)
+ FOR_EACH (ProgressBarVectorCIter, it, mBars)
{
ProgressBar *bar = *it;
if (!bar)
@@ -154,13 +155,10 @@ void MiniStatusWindow::updateBars()
{
int x = 0;
const ProgressBar *lastBar = nullptr;
- for (std::vector <ProgressBar*>::const_iterator it = mBars.begin(),
- it_end = mBars.end(); it != it_end; ++it)
- {
+ FOR_EACH (ProgressBarVectorCIter, it, mBars)
safeRemove(*it);
- }
- for (std::vector <ProgressBar*>::const_iterator it = mBars.begin(),
- it_end = mBars.end(); it != it_end; ++it)
+
+ FOR_EACH (ProgressBarVectorCIter, it, mBars)
{
ProgressBar *const bar = *it;
if (!bar)
@@ -456,8 +454,7 @@ void MiniStatusWindow::loadBars()
void MiniStatusWindow::saveBars()
{
int i = 0;
- for (std::vector <ProgressBar*>::const_iterator it = mBars.begin(),
- it_end = mBars.end(); it != it_end; ++it)
+ FOR_EACH (ProgressBarVectorCIter, it, mBars)
{
const ProgressBar *const bar = *it;
if (!bar->isVisible())