diff options
Diffstat (limited to 'src/gui/ministatuswindow.cpp')
-rw-r--r-- | src/gui/ministatuswindow.cpp | 17 |
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()) |