diff options
| author | Tobias Markmann <tm@ayena.de> | 2015-10-01 10:01:41 (GMT) |
|---|---|---|
| committer | Swift Review <review@swift.im> | 2015-10-14 16:36:29 (GMT) |
| commit | 192e8631d4c9a196e13a20d22f57c392bac9dd73 (patch) | |
| tree | 408ea2d461eaff1ca3d97ee0e00edb2e1d01754f /Swift/Controllers/Roster | |
| parent | b00c84574fc730eeeabb57df1f17b54855218193 (diff) | |
| download | swift-192e8631d4c9a196e13a20d22f57c392bac9dd73.zip swift-192e8631d4c9a196e13a20d22f57c392bac9dd73.tar.bz2 | |
Annotate getter method as const as it does not write anything
Test-Information:
Still builds and unit tests pass.
Change-Id: I472491184ba10ec3bdbd4cb94613768639ac6f57
Diffstat (limited to 'Swift/Controllers/Roster')
| -rw-r--r-- | Swift/Controllers/Roster/Roster.cpp | 11 | ||||
| -rw-r--r-- | Swift/Controllers/Roster/Roster.h | 9 |
2 files changed, 10 insertions, 10 deletions
diff --git a/Swift/Controllers/Roster/Roster.cpp b/Swift/Controllers/Roster/Roster.cpp index 49338a4..84561e5 100644 --- a/Swift/Controllers/Roster/Roster.cpp +++ b/Swift/Controllers/Roster/Roster.cpp @@ -1,31 +1,30 @@ /* - * Copyright (c) 2010-2013 Isode Limited. + * Copyright (c) 2010-2015 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #include <Swift/Controllers/Roster/Roster.h> -#include <string> -#include <iostream> -#include <set> #include <deque> +#include <set> +#include <string> #include <boost/bind.hpp> #include <Swiften/Base/foreach.h> #include <Swiften/JID/JID.h> #include <Swift/Controllers/Roster/ContactRosterItem.h> -#include <Swift/Controllers/Roster/RosterItem.h> #include <Swift/Controllers/Roster/GroupRosterItem.h> #include <Swift/Controllers/Roster/ItemOperations/RosterItemOperation.h> +#include <Swift/Controllers/Roster/RosterItem.h> namespace Swift { Roster::Roster(bool sortByStatus, bool fullJIDMapping) : blockingSupported_(false) { sortByStatus_ = sortByStatus; fullJIDMapping_ = fullJIDMapping; root_ = new GroupRosterItem("Dummy-Root", NULL, sortByStatus_); root_->onChildrenChanged.connect(boost::bind(&Roster::handleChildrenChanged, this, root_)); } @@ -42,19 +41,19 @@ Roster::~Roster() { } ContactRosterItem* contact = dynamic_cast<ContactRosterItem*>(item); if (contact) { contact->onVCardRequested.disconnect(boost::bind(boost::ref(onVCardUpdateRequested), contact->getJID())); } delete item; } } -GroupRosterItem* Roster::getRoot() { +GroupRosterItem* Roster::getRoot() const { return root_; } GroupRosterItem* Roster::getGroup(const std::string& groupName) { foreach (RosterItem *item, root_->getChildren()) { GroupRosterItem *group = dynamic_cast<GroupRosterItem*>(item); if (group && group->getDisplayName() == groupName) { return group; } diff --git a/Swift/Controllers/Roster/Roster.h b/Swift/Controllers/Roster/Roster.h index e035169..c25feaa 100644 --- a/Swift/Controllers/Roster/Roster.h +++ b/Swift/Controllers/Roster/Roster.h @@ -1,29 +1,30 @@ /* - * Copyright (c) 2010-2013 Isode Limited. + * Copyright (c) 2010-2015 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once +#include <map> +#include <set> #include <string> #include <vector> -#include <map> #include <boost/shared_ptr.hpp> #include <Swiften/Base/boost_bsignals.h> #include <Swiften/JID/JID.h> +#include <Swift/Controllers/Roster/ContactRosterItem.h> #include <Swift/Controllers/Roster/ItemOperations/RosterItemOperation.h> #include <Swift/Controllers/Roster/RosterFilter.h> -#include <Swift/Controllers/Roster/ContactRosterItem.h> namespace Swift { class RosterItem; class GroupRosterItem; class ContactRosterItem; class Roster { public: @@ -34,19 +35,19 @@ class Roster { void removeContact(const JID& jid); void removeContactFromGroup(const JID& jid, const std::string& group); void removeGroup(const std::string& group); void removeAll(); void applyOnItems(const RosterItemOperation& operation); void applyOnAllItems(const RosterItemOperation& operation); void applyOnItem(const RosterItemOperation& operation, const JID& jid); void addFilter(RosterFilter* filter); void removeFilter(RosterFilter* filter); - GroupRosterItem* getRoot(); + GroupRosterItem* getRoot() const; std::vector<RosterFilter*> getFilters() {return filters_;} boost::signal<void (GroupRosterItem*)> onChildrenChanged; boost::signal<void (GroupRosterItem*)> onGroupAdded; boost::signal<void (RosterItem*)> onDataChanged; boost::signal<void (JID&)> onVCardUpdateRequested; boost::signal<void (RosterFilter* filter)> onFilterAdded; boost::signal<void (RosterFilter* filter)> onFilterRemoved; GroupRosterItem* getGroup(const std::string& groupName); void setBlockingSupported(bool isSupported); |
Swift