summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2016-11-23 07:09:39 (GMT)
committerTobias Markmann <tm@ayena.de>2016-11-23 11:30:02 (GMT)
commite405ff3561be3d3c0bd79d7d5173923a8828cf02 (patch)
tree9118ef838ebfaec1df90ec24761944b5d833774c /Swift/Controllers/Roster
parent8a71b91be885652f37c5aab5e1ecf25af4599fbc (diff)
downloadswift-e405ff3561be3d3c0bd79d7d5173923a8828cf02.zip
swift-e405ff3561be3d3c0bd79d7d5173923a8828cf02.tar.bz2
Migrate remaining Swiften/Base/foreach.h use to range-based for loop
Test-Information: Build on macOS 10.12.1 and all tests pass. Change-Id: Iedaa3fa7e7672c77909fd0568bf30e9393cb87e0
Diffstat (limited to 'Swift/Controllers/Roster')
-rw-r--r--Swift/Controllers/Roster/ContactRosterItem.cpp1
-rw-r--r--Swift/Controllers/Roster/RosterGroupExpandinessPersister.cpp3
-rw-r--r--Swift/Controllers/Roster/TableRoster.cpp5
3 files changed, 3 insertions, 6 deletions
diff --git a/Swift/Controllers/Roster/ContactRosterItem.cpp b/Swift/Controllers/Roster/ContactRosterItem.cpp
index 71c5f8e..8fdf183 100644
--- a/Swift/Controllers/Roster/ContactRosterItem.cpp
+++ b/Swift/Controllers/Roster/ContactRosterItem.cpp
@@ -9,7 +9,6 @@
#include <boost/date_time/posix_time/posix_time.hpp>
#include <Swiften/Base/DateTime.h>
-#include <Swiften/Base/foreach.h>
#include <Swiften/Elements/Idle.h>
#include <Swiften/Elements/Presence.h>
diff --git a/Swift/Controllers/Roster/RosterGroupExpandinessPersister.cpp b/Swift/Controllers/Roster/RosterGroupExpandinessPersister.cpp
index af89b54..0f07c0b 100644
--- a/Swift/Controllers/Roster/RosterGroupExpandinessPersister.cpp
+++ b/Swift/Controllers/Roster/RosterGroupExpandinessPersister.cpp
@@ -11,7 +11,6 @@
#include <boost/bind.hpp>
#include <Swiften/Base/String.h>
-#include <Swiften/Base/foreach.h>
#include <Swift/Controllers/Roster/GroupRosterItem.h>
#include <Swift/Controllers/SettingConstants.h>
@@ -45,7 +44,7 @@ void RosterGroupExpandinessPersister::handleExpandedChanged(GroupRosterItem* gro
void RosterGroupExpandinessPersister::save() {
std::string setting;
- foreach (const std::string& group, collapsed_) {
+ for (const auto& group : collapsed_) {
if (!setting.empty()) {
setting += "\n";
}
diff --git a/Swift/Controllers/Roster/TableRoster.cpp b/Swift/Controllers/Roster/TableRoster.cpp
index f164a4d..713f390 100644
--- a/Swift/Controllers/Roster/TableRoster.cpp
+++ b/Swift/Controllers/Roster/TableRoster.cpp
@@ -12,7 +12,6 @@
#include <boost/cast.hpp>
#include <boost/numeric/conversion/cast.hpp>
-#include <Swiften/Base/foreach.h>
#include <Swiften/Network/Timer.h>
#include <Swiften/Network/TimerFactory.h>
@@ -104,11 +103,11 @@ void TableRoster::handleUpdateTimerTick() {
// Get a model for the new roster
std::vector<Section> newSections;
if (model) {
- foreach(RosterItem* item, model->getRoot()->getDisplayedChildren()) {
+ for (auto item : model->getRoot()->getDisplayedChildren()) {
if (GroupRosterItem* groupItem = boost::polymorphic_downcast<GroupRosterItem*>(item)) {
//std::cerr << "* " << groupItem->getDisplayName() << std::endl;
Section section(groupItem->getDisplayName());
- foreach(RosterItem* groupChildItem, groupItem->getDisplayedChildren()) {
+ for (auto groupChildItem : groupItem->getDisplayedChildren()) {
if (ContactRosterItem* contact = boost::polymorphic_downcast<ContactRosterItem*>(groupChildItem)) {
//std::cerr << " - " << contact->getDisplayJID() << std::endl;
section.items.push_back(Item(contact->getDisplayName(), contact->getStatusText(), contact->getDisplayJID(), contact->getStatusShow(), contact->getAvatarPath()));