summaryrefslogtreecommitdiff
path: root/src/gui/widgets
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-01-20 20:43:54 +0300
committerAndrei Karas <akaras@inbox.ru>2013-01-20 23:48:07 +0300
commit2744e4fa8f39cd06bfe557a5a3881830bd11501c (patch)
tree2ec96c6ee820cfe0e5e76480fe828501bf555a4b /src/gui/widgets
parent531433248fbad49e2b8e9d90de9855f3ea9b2257 (diff)
downloadmv-2744e4fa8f39cd06bfe557a5a3881830bd11501c.tar.gz
mv-2744e4fa8f39cd06bfe557a5a3881830bd11501c.tar.bz2
mv-2744e4fa8f39cd06bfe557a5a3881830bd11501c.tar.xz
mv-2744e4fa8f39cd06bfe557a5a3881830bd11501c.zip
Last part with FOR_EACH changes.
Diffstat (limited to 'src/gui/widgets')
-rw-r--r--src/gui/widgets/browserbox.cpp12
-rw-r--r--src/gui/widgets/extendednamesmodel.cpp3
-rw-r--r--src/gui/widgets/itemcontainer.cpp12
-rw-r--r--src/gui/widgets/setuptouchitem.cpp3
-rw-r--r--src/gui/widgets/tabbedarea.cpp6
-rw-r--r--src/gui/widgets/tabstrip.cpp3
-rw-r--r--src/gui/widgets/vertcontainer.cpp6
-rw-r--r--src/gui/widgets/windowcontainer.cpp3
8 files changed, 14 insertions, 34 deletions
diff --git a/src/gui/widgets/browserbox.cpp b/src/gui/widgets/browserbox.cpp
index e931c7626..8236dbdd3 100644
--- a/src/gui/widgets/browserbox.cpp
+++ b/src/gui/widgets/browserbox.cpp
@@ -253,8 +253,7 @@ void BrowserBox::addRow(const std::string &row, const bool atTop)
const int hyphenWidth = font->getWidth(hyphen);
unsigned x = 0;
- for (TextRowCIter i = mTextRows.begin(), i_end = mTextRows.end();
- i != i_end; ++ i)
+ FOR_EACH (TextRowCIter, i, mTextRows)
{
std::string tempRow = *i;
for (unsigned int j = 0, sz = static_cast<unsigned int>(
@@ -413,8 +412,7 @@ void BrowserBox::draw(gcn::Graphics *graphics)
gcn::Font *const font = getFont();
- for (LinePartCIter i = mLineParts.begin(), i_end = mLineParts.end();
- i != i_end; ++i)
+ FOR_EACH (LinePartCIter, i, mLineParts)
{
const LinePart &part = *i;
if (part.mY + 50 < mYStart)
@@ -465,8 +463,7 @@ int BrowserBox::calcHeight()
mLineParts.clear();
- for (TextRowCIter i = mTextRows.begin(), i_end = mTextRows.end();
- i != i_end; ++ i)
+ FOR_EACH (TextRowCIter, i, mTextRows)
{
const std::string row = *(i);
bool wrapped = false;
@@ -753,8 +750,7 @@ std::string BrowserBox::getTextAtPos(const int x, const int y) const
int lastY = 0;
- for (LinePartCIter i = mLineParts.begin(), i_end = mLineParts.end();
- i != i_end; ++i)
+ FOR_EACH (LinePartCIter, i, mLineParts)
{
const LinePart &part = *i;
if (part.mY + 50 < mYStart)
diff --git a/src/gui/widgets/extendednamesmodel.cpp b/src/gui/widgets/extendednamesmodel.cpp
index 015d4d685..90deb999c 100644
--- a/src/gui/widgets/extendednamesmodel.cpp
+++ b/src/gui/widgets/extendednamesmodel.cpp
@@ -59,8 +59,7 @@ const Image *ExtendedNamesModel::getImageAt(int i)
void ExtendedNamesModel::clear()
{
mNames.clear();
- for (std::vector<Image*>::iterator it = mImages.begin(),
- it_end = mImages.end(); it != it_end; ++ it)
+ FOR_EACH (std::vector<Image*>::iterator, it, mImages)
{
if (*it)
(*it)->decRef();
diff --git a/src/gui/widgets/itemcontainer.cpp b/src/gui/widgets/itemcontainer.cpp
index 42c9bafcf..e11e27fd6 100644
--- a/src/gui/widgets/itemcontainer.cpp
+++ b/src/gui/widgets/itemcontainer.cpp
@@ -354,9 +354,7 @@ Item *ItemContainer::getSelectedItem() const
void ItemContainer::distributeValueChangedEvent()
{
- for (SelectionListenerIterator i = mSelectionListeners.begin(),
- i_end = mSelectionListeners.end();
- i != i_end; ++i)
+ FOR_EACH (SelectionListenerIterator, i, mSelectionListeners)
{
if (*i)
{
@@ -576,8 +574,7 @@ void ItemContainer::updateMatrix()
int jMult = j * mGridColumns;
const int maxSize = mGridRows * mGridColumns;
- for (std::vector<ItemIdPair*>::const_iterator iter = sortedItems.begin(),
- iter_end = sortedItems.end(); iter != iter_end; ++ iter)
+ FOR_EACH (std::vector<ItemIdPair*>::const_iterator, iter, sortedItems)
{
if (jMult >= maxSize)
break;
@@ -593,11 +590,8 @@ void ItemContainer::updateMatrix()
}
}
- for (int idx = j * mGridColumns + i;
- idx < maxSize; idx ++)
- {
+ for (int idx = j * mGridColumns + i; idx < maxSize; idx ++)
mShowMatrix[idx] = -1;
- }
for (size_t idx = 0, sz = sortedItems.size(); idx < sz; idx ++)
delete sortedItems[idx];
diff --git a/src/gui/widgets/setuptouchitem.cpp b/src/gui/widgets/setuptouchitem.cpp
index 7cb84ae81..8f8ec500c 100644
--- a/src/gui/widgets/setuptouchitem.cpp
+++ b/src/gui/widgets/setuptouchitem.cpp
@@ -56,8 +56,7 @@ TouchActionsModel::TouchActionsModel() :
std::sort(data.begin(), data.end(), touchActionSorter);
int cnt = 0;
- for (std::vector<SetupActionData*>::iterator it = data.begin(),
- it_end = data.end(); it != it_end; ++ it)
+ FOR_EACH (std::vector<SetupActionData*>::iterator, it, data)
{
const SetupActionData *data1 = *it;
mNames.push_back(data1->name);
diff --git a/src/gui/widgets/tabbedarea.cpp b/src/gui/widgets/tabbedarea.cpp
index e930ab60d..b0999fbd4 100644
--- a/src/gui/widgets/tabbedarea.cpp
+++ b/src/gui/widgets/tabbedarea.cpp
@@ -343,8 +343,7 @@ int TabbedArea::getSelectedTabIndex() const
void TabbedArea::setSelectedTabByName(const std::string &name)
{
- for (TabContainer::const_iterator itr = mTabs.begin(),
- itr_end = mTabs.end(); itr != itr_end; ++itr)
+ FOR_EACH (TabContainer::const_iterator, itr, mTabs)
{
if ((*itr).first && (*itr).first->getCaption() == name)
{
@@ -430,8 +429,7 @@ void TabbedArea::widgetResized(const gcn::Event &event A_UNUSED)
void TabbedArea::updateTabsWidth()
{
mTabsWidth = 0;
- for (TabContainer::const_iterator itr = mTabs.begin(),
- itr_end = mTabs.end(); itr != itr_end; ++itr)
+ FOR_EACH (TabContainer::const_iterator, itr, mTabs)
{
if ((*itr).first)
mTabsWidth += (*itr).first->getWidth();
diff --git a/src/gui/widgets/tabstrip.cpp b/src/gui/widgets/tabstrip.cpp
index 2ecbb5eed..e0a4b0461 100644
--- a/src/gui/widgets/tabstrip.cpp
+++ b/src/gui/widgets/tabstrip.cpp
@@ -57,8 +57,7 @@ void TabStrip::action(const gcn::ActionEvent &event)
gcn::Widget *const widget = event.getSource();
if (static_cast<Button*>(widget)->isPressed2())
{
- for (WidgetListConstIterator iter = mWidgets.begin();
- iter != mWidgets.end(); ++ iter)
+ FOR_EACH (WidgetListConstIterator, iter, mWidgets)
{
if (*iter != widget)
{
diff --git a/src/gui/widgets/vertcontainer.cpp b/src/gui/widgets/vertcontainer.cpp
index 0bda6c869..c8bc862ee 100644
--- a/src/gui/widgets/vertcontainer.cpp
+++ b/src/gui/widgets/vertcontainer.cpp
@@ -79,10 +79,6 @@ void VertContainer::clear()
void VertContainer::widgetResized(const gcn::Event &event A_UNUSED)
{
- for (std::vector<gcn::Widget*>::const_iterator
- it = mResizableWidgets.begin(), it_end = mResizableWidgets.end();
- it != it_end; ++ it)
- {
+ FOR_EACH (std::vector<gcn::Widget*>::const_iterator, it, mResizableWidgets)
(*it)->setWidth(getWidth());
- }
}
diff --git a/src/gui/widgets/windowcontainer.cpp b/src/gui/widgets/windowcontainer.cpp
index 1c4b926f5..2447e12e4 100644
--- a/src/gui/widgets/windowcontainer.cpp
+++ b/src/gui/widgets/windowcontainer.cpp
@@ -54,8 +54,7 @@ void WindowContainer::scheduleDelete(gcn::Widget *const widget)
void WindowContainer::adjustAfterResize(const int oldScreenWidth,
const int oldScreenHeight)
{
- for (WidgetListIterator i = mWidgets.begin(), i_end = mWidgets.end();
- i != i_end; ++i)
+ FOR_EACH (WidgetListIterator, i, mWidgets)
{
if (Window *const window = dynamic_cast<Window*>(*i))
window->adjustPositionAfterResize(oldScreenWidth, oldScreenHeight);