diff options
author | Remko Tronçon <git@el-tramo.be> | 2011-06-13 15:33:13 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2011-06-13 16:57:09 (GMT) |
commit | 790134ceb34ab6047fe204517d263f343dbeb920 (patch) | |
tree | d8002133de67108f380248a0ec7d063c8f1956b7 /Swift/Controllers/Roster | |
parent | a03cedb3942e4c7c90e62fe9a73c6d15e38fbb68 (diff) | |
download | swift-contrib-790134ceb34ab6047fe204517d263f343dbeb920.zip swift-contrib-790134ceb34ab6047fe204517d263f343dbeb920.tar.bz2 |
Added CppCheck script.
Tweaked the sources to satisfy cppcheck.
Diffstat (limited to 'Swift/Controllers/Roster')
-rw-r--r-- | Swift/Controllers/Roster/ContactRosterItem.cpp | 2 | ||||
-rw-r--r-- | Swift/Controllers/Roster/GroupRosterItem.cpp | 6 | ||||
-rw-r--r-- | Swift/Controllers/Roster/Roster.cpp | 6 |
3 files changed, 7 insertions, 7 deletions
diff --git a/Swift/Controllers/Roster/ContactRosterItem.cpp b/Swift/Controllers/Roster/ContactRosterItem.cpp index 894f64b..bbe81e6 100644 --- a/Swift/Controllers/Roster/ContactRosterItem.cpp +++ b/Swift/Controllers/Roster/ContactRosterItem.cpp @@ -91,7 +91,7 @@ void ContactRosterItem::applyPresence(const std::string& resource, boost::shared presences_.erase(resource); } } - if (presences_.size() == 0) { + if (presences_.empty()) { offlinePresence_ = presence; } } else { diff --git a/Swift/Controllers/Roster/GroupRosterItem.cpp b/Swift/Controllers/Roster/GroupRosterItem.cpp index 2b56d1f..2a7bfa5 100644 --- a/Swift/Controllers/Roster/GroupRosterItem.cpp +++ b/Swift/Controllers/Roster/GroupRosterItem.cpp @@ -89,7 +89,7 @@ void GroupRosterItem::removeAll() { delete group; } } - it++; + ++it; } children_.clear(); } @@ -117,7 +117,7 @@ ContactRosterItem* GroupRosterItem::removeChild(const JID& jid) { removed = groupRemoved; } } - it++; + ++it; } onChildrenChanged(); onDataChanged(); @@ -136,7 +136,7 @@ GroupRosterItem* GroupRosterItem::removeGroupChild(const std::string& groupName) it = children_.erase(it); continue; } - it++; + ++it; } onChildrenChanged(); onDataChanged(); diff --git a/Swift/Controllers/Roster/Roster.cpp b/Swift/Controllers/Roster/Roster.cpp index 4e34105..a62a18a 100644 --- a/Swift/Controllers/Roster/Roster.cpp +++ b/Swift/Controllers/Roster/Roster.cpp @@ -107,7 +107,7 @@ void Roster::removeAll() { void Roster::removeContact(const JID& jid) { std::vector<ContactRosterItem*>* items = &itemMap_[fullJIDMapping_ ? jid : jid.toBare()]; items->erase(std::remove_if(items->begin(), items->end(), JIDEqualsTo(jid)), items->end()); - if (items->size() == 0) { + if (items->empty()) { itemMap_.erase(fullJIDMapping_ ? jid : jid.toBare()); } //Causes the delete @@ -124,7 +124,7 @@ void Roster::removeContactFromGroup(const JID& jid, const std::string& groupName std::vector<ContactRosterItem*>* items = &itemMap_[fullJIDMapping_ ? jid : jid.toBare()]; items->erase(std::remove(items->begin(), items->end(), deleted), items->end()); } - it++; + ++it; } foreach (ContactRosterItem* item, itemMap_[fullJIDMapping_ ? jid : jid.toBare()]) { item->removeGroup(groupName); @@ -179,7 +179,7 @@ void Roster::filterContact(ContactRosterItem* contact, GroupRosterItem* group) { foreach (RosterFilter *filter, filters_) { hide &= (*filter)(contact); } - group->setDisplayed(contact, filters_.size() == 0 || !hide); + group->setDisplayed(contact, filters_.empty() || !hide); int newDisplayedSize = group->getDisplayedChildren().size(); if (oldDisplayedSize == 0 && newDisplayedSize > 0) { onGroupAdded(group); |