diff options
author | Tobias Markmann <tm@ayena.de> | 2016-11-23 07:09:39 (GMT) |
---|---|---|
committer | Tobias Markmann <tm@ayena.de> | 2016-11-23 11:30:02 (GMT) |
commit | e405ff3561be3d3c0bd79d7d5173923a8828cf02 (patch) | |
tree | 9118ef838ebfaec1df90ec24761944b5d833774c /Swift/QtUI/QtStatusWidget.cpp | |
parent | 8a71b91be885652f37c5aab5e1ecf25af4599fbc (diff) | |
download | swift-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/QtUI/QtStatusWidget.cpp')
-rw-r--r-- | Swift/QtUI/QtStatusWidget.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Swift/QtUI/QtStatusWidget.cpp b/Swift/QtUI/QtStatusWidget.cpp index 2e9e4cc..b175e5c 100644 --- a/Swift/QtUI/QtStatusWidget.cpp +++ b/Swift/QtUI/QtStatusWidget.cpp @@ -144,7 +144,7 @@ void QtStatusWidget::generateList() { QString text = statusEdit_->text(); newStatusText_ = text; menu_->clear(); - foreach (StatusShow::Type type, icons_.keys()) { + for (const auto& type : icons_.keys()) { QListWidgetItem* item = new QListWidgetItem(text == "" ? getNoMessage() : text, menu_); item->setIcon(icons_[type]); item->setToolTip(P2QSTRING(statusShowTypeToFriendlyName(type)) + ": " + item->text()); @@ -152,7 +152,7 @@ void QtStatusWidget::generateList() { item->setData(Qt::UserRole, QVariant(type)); } std::vector<StatusCache::PreviousStatus> previousStatuses = statusCache_->getMatches(Q2PSTRING(text), 8); - foreach (StatusCache::PreviousStatus savedStatus, previousStatuses) { + for (const auto& savedStatus : previousStatuses) { if (savedStatus.first.empty() || std::find_if(allTypes_.begin(), allTypes_.end(), savedStatus.second == lambda::_1 && savedStatus.first == lambda::bind(&statusShowTypeToFriendlyName, lambda::_1)) != allTypes_.end()) { continue; @@ -163,7 +163,7 @@ void QtStatusWidget::generateList() { item->setStatusTip(item->toolTip()); item->setData(Qt::UserRole, QVariant(savedStatus.second)); } - foreach (StatusShow::Type type, icons_.keys()) { + for (const auto& type : icons_.keys()) { if (Q2PSTRING(text) == statusShowTypeToFriendlyName(type)) { continue; } @@ -203,7 +203,7 @@ void QtStatusWidget::handleClicked() { if (x + width > screenWidth) { x = screenWidth - width; } - //foreach (StatusShow::Type type, allTypes_) { + //for (StatusShow::Type type : allTypes_) { // if (statusEdit_->text() == P2QSTRING(statusShowTypeToFriendlyName(type))) { statusEdit_->setText(""); // } |