summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2011-06-13 15:33:13 (GMT)
committerRemko Tronçon <git@el-tramo.be>2011-06-13 16:57:09 (GMT)
commit790134ceb34ab6047fe204517d263f343dbeb920 (patch)
treed8002133de67108f380248a0ec7d063c8f1956b7 /Swift/Controllers/Roster/Roster.cpp
parenta03cedb3942e4c7c90e62fe9a73c6d15e38fbb68 (diff)
downloadswift-contrib-790134ceb34ab6047fe204517d263f343dbeb920.zip
swift-contrib-790134ceb34ab6047fe204517d263f343dbeb920.tar.bz2
Added CppCheck script.
Tweaked the sources to satisfy cppcheck.
Diffstat (limited to 'Swift/Controllers/Roster/Roster.cpp')
-rw-r--r--Swift/Controllers/Roster/Roster.cpp6
1 files changed, 3 insertions, 3 deletions
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);