summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-01-22 16:29:31 +0300
committerAndrei Karas <akaras@inbox.ru>2013-01-22 16:29:31 +0300
commit1295d37475ec737930cc222953d773f79d8d8eba (patch)
tree57abec5885bb9b6f9e9db68a41e0673b91e05d10 /src
parent2d4e2d93267392487c17cfc6b2649bdd29d42456 (diff)
downloadplus-1295d37475ec737930cc222953d773f79d8d8eba.tar.gz
plus-1295d37475ec737930cc222953d773f79d8d8eba.tar.bz2
plus-1295d37475ec737930cc222953d773f79d8d8eba.tar.xz
plus-1295d37475ec737930cc222953d773f79d8d8eba.zip
Improve a bit online list draw.
Diffstat (limited to 'src')
-rw-r--r--src/gui/whoisonline.cpp20
1 files changed, 9 insertions, 11 deletions
diff --git a/src/gui/whoisonline.cpp b/src/gui/whoisonline.cpp
index d7d67fbc2..73dcf008a 100644
--- a/src/gui/whoisonline.cpp
+++ b/src/gui/whoisonline.cpp
@@ -194,9 +194,9 @@ void WhoIsOnline::updateWindow(std::vector<OnlinePlayer*> &friends,
std::sort(neutral.begin(), neutral.end(), nameCompare);
std::sort(disregard.begin(), disregard.end(), nameCompare);
bool addedFromSection(false);
- for (size_t i = 0, sz = friends.size(); i < sz; i++)
+ FOR_EACH (std::vector<OnlinePlayer*>::const_iterator, it, friends)
{
- mBrowserBox->addRow(friends.at(i)->getText());
+ mBrowserBox->addRow((*it)->getText());
addedFromSection = true;
}
if (addedFromSection == true)
@@ -204,9 +204,9 @@ void WhoIsOnline::updateWindow(std::vector<OnlinePlayer*> &friends,
mBrowserBox->addRow("---");
addedFromSection = false;
}
- for (size_t i = 0, sz = enemy.size(); i < sz; i++)
+ FOR_EACH (std::vector<OnlinePlayer*>::const_iterator, it, enemy)
{
- mBrowserBox->addRow(enemy.at(i)->getText());
+ mBrowserBox->addRow((*it)->getText());
addedFromSection = true;
}
if (addedFromSection == true)
@@ -214,18 +214,16 @@ void WhoIsOnline::updateWindow(std::vector<OnlinePlayer*> &friends,
mBrowserBox->addRow("---");
addedFromSection = false;
}
- for (size_t i = 0, sz = neutral.size(); i < sz; i++)
+ FOR_EACH (std::vector<OnlinePlayer*>::const_iterator, it, neutral)
{
- mBrowserBox->addRow(neutral.at(i)->getText());
+ mBrowserBox->addRow((*it)->getText());
addedFromSection = true;
}
if (addedFromSection == true && !disregard.empty())
- {
mBrowserBox->addRow("---");
-// addedFromSection = false;
- }
- for (size_t i = 0, sz = disregard.size(); i < sz; i++)
- mBrowserBox->addRow(disregard.at(i)->getText());
+
+ FOR_EACH (std::vector<OnlinePlayer*>::const_iterator, it, disregard)
+ mBrowserBox->addRow((*it)->getText());
if (mScrollArea->getVerticalMaxScroll() <
mScrollArea->getVerticalScrollAmount())