diff options
Diffstat (limited to 'Swift/QtUI/UserSearch/QtContactListWidget.cpp')
-rw-r--r-- | Swift/QtUI/UserSearch/QtContactListWidget.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Swift/QtUI/UserSearch/QtContactListWidget.cpp b/Swift/QtUI/UserSearch/QtContactListWidget.cpp index 1dbfc1f..73a8482 100644 --- a/Swift/QtUI/UserSearch/QtContactListWidget.cpp +++ b/Swift/QtUI/UserSearch/QtContactListWidget.cpp @@ -58,46 +58,46 @@ QtContactListWidget::QtContactListWidget(QWidget* parent, SettingsProvider* sett } QtContactListWidget::~QtContactListWidget() { delete contactListDelegate_; delete removableItemDelegate_; delete contactListModel_; } void QtContactListWidget::setList(const std::vector<Contact::ref>& list) { contactListModel_->setList(list); } std::vector<Contact::ref> QtContactListWidget::getList() const { return contactListModel_->getList(); } Contact::ref QtContactListWidget::getContact(const size_t i) { return contactListModel_->getContact(i); } void QtContactListWidget::setMaximumNoOfContactsToOne(bool limited) { limited_ = limited; } bool QtContactListWidget::isFull() const { return limited_ && (getList().size() == 1); } void QtContactListWidget::updateContacts(const std::vector<Contact::ref>& contactUpdates) { std::vector<Contact::ref> contacts = contactListModel_->getList(); - foreach(const Contact::ref& contactUpdate, contactUpdates) { - for(auto& contact : contacts) { + for (const auto& contactUpdate : contactUpdates) { + for (auto&& contact : contacts) { if (contactUpdate->jid == contact->jid) { contact = contactUpdate; break; } } } contactListModel_->setList(contacts); } void QtContactListWidget::handleSettingsChanged(const std::string&) { contactListDelegate_->setCompact(settings_->getSetting(QtUISettingConstants::COMPACT_ROSTER)); } } |