summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2015-10-01 10:01:41 (GMT)
committerSwift Review <review@swift.im>2015-10-14 16:36:29 (GMT)
commit192e8631d4c9a196e13a20d22f57c392bac9dd73 (patch)
tree408ea2d461eaff1ca3d97ee0e00edb2e1d01754f
parentb00c84574fc730eeeabb57df1f17b54855218193 (diff)
downloadswift-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
-rw-r--r--Swift/Controllers/Roster/Roster.cpp11
-rw-r--r--Swift/Controllers/Roster/Roster.h9
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,27 +1,26 @@
1/* 1/*
2 * Copyright (c) 2010-2013 Isode Limited. 2 * Copyright (c) 2010-2015 Isode Limited.
3 * All rights reserved. 3 * All rights reserved.
4 * See the COPYING file for more information. 4 * See the COPYING file for more information.
5 */ 5 */
6 6
7#include <Swift/Controllers/Roster/Roster.h> 7#include <Swift/Controllers/Roster/Roster.h>
8 8
9#include <string>
10#include <iostream>
11#include <set>
12#include <deque> 9#include <deque>
10#include <set>
11#include <string>
13 12
14#include <boost/bind.hpp> 13#include <boost/bind.hpp>
15 14
16#include <Swiften/Base/foreach.h> 15#include <Swiften/Base/foreach.h>
17#include <Swiften/JID/JID.h> 16#include <Swiften/JID/JID.h>
18 17
19#include <Swift/Controllers/Roster/ContactRosterItem.h> 18#include <Swift/Controllers/Roster/ContactRosterItem.h>
20#include <Swift/Controllers/Roster/RosterItem.h>
21#include <Swift/Controllers/Roster/GroupRosterItem.h> 19#include <Swift/Controllers/Roster/GroupRosterItem.h>
22#include <Swift/Controllers/Roster/ItemOperations/RosterItemOperation.h> 20#include <Swift/Controllers/Roster/ItemOperations/RosterItemOperation.h>
21#include <Swift/Controllers/Roster/RosterItem.h>
23 22
24namespace Swift { 23namespace Swift {
25 24
26Roster::Roster(bool sortByStatus, bool fullJIDMapping) : blockingSupported_(false) { 25Roster::Roster(bool sortByStatus, bool fullJIDMapping) : blockingSupported_(false) {
27 sortByStatus_ = sortByStatus; 26 sortByStatus_ = sortByStatus;
@@ -46,11 +45,11 @@ Roster::~Roster() {
46 } 45 }
47 delete item; 46 delete item;
48 } 47 }
49} 48}
50 49
51GroupRosterItem* Roster::getRoot() { 50GroupRosterItem* Roster::getRoot() const {
52 return root_; 51 return root_;
53} 52}
54 53
55GroupRosterItem* Roster::getGroup(const std::string& groupName) { 54GroupRosterItem* Roster::getGroup(const std::string& groupName) {
56 foreach (RosterItem *item, root_->getChildren()) { 55 foreach (RosterItem *item, root_->getChildren()) {
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,25 +1,26 @@
1/* 1/*
2 * Copyright (c) 2010-2013 Isode Limited. 2 * Copyright (c) 2010-2015 Isode Limited.
3 * All rights reserved. 3 * All rights reserved.
4 * See the COPYING file for more information. 4 * See the COPYING file for more information.
5 */ 5 */
6 6
7#pragma once 7#pragma once
8 8
9#include <map>
10#include <set>
9#include <string> 11#include <string>
10#include <vector> 12#include <vector>
11#include <map>
12 13
13#include <boost/shared_ptr.hpp> 14#include <boost/shared_ptr.hpp>
14 15
15#include <Swiften/Base/boost_bsignals.h> 16#include <Swiften/Base/boost_bsignals.h>
16#include <Swiften/JID/JID.h> 17#include <Swiften/JID/JID.h>
17 18
19#include <Swift/Controllers/Roster/ContactRosterItem.h>
18#include <Swift/Controllers/Roster/ItemOperations/RosterItemOperation.h> 20#include <Swift/Controllers/Roster/ItemOperations/RosterItemOperation.h>
19#include <Swift/Controllers/Roster/RosterFilter.h> 21#include <Swift/Controllers/Roster/RosterFilter.h>
20#include <Swift/Controllers/Roster/ContactRosterItem.h>
21 22
22namespace Swift { 23namespace Swift {
23 24
24class RosterItem; 25class RosterItem;
25class GroupRosterItem; 26class GroupRosterItem;
@@ -38,11 +39,11 @@ class Roster {
38 void applyOnItems(const RosterItemOperation& operation); 39 void applyOnItems(const RosterItemOperation& operation);
39 void applyOnAllItems(const RosterItemOperation& operation); 40 void applyOnAllItems(const RosterItemOperation& operation);
40 void applyOnItem(const RosterItemOperation& operation, const JID& jid); 41 void applyOnItem(const RosterItemOperation& operation, const JID& jid);
41 void addFilter(RosterFilter* filter); 42 void addFilter(RosterFilter* filter);
42 void removeFilter(RosterFilter* filter); 43 void removeFilter(RosterFilter* filter);
43 GroupRosterItem* getRoot(); 44 GroupRosterItem* getRoot() const;
44 std::vector<RosterFilter*> getFilters() {return filters_;} 45 std::vector<RosterFilter*> getFilters() {return filters_;}
45 boost::signal<void (GroupRosterItem*)> onChildrenChanged; 46 boost::signal<void (GroupRosterItem*)> onChildrenChanged;
46 boost::signal<void (GroupRosterItem*)> onGroupAdded; 47 boost::signal<void (GroupRosterItem*)> onGroupAdded;
47 boost::signal<void (RosterItem*)> onDataChanged; 48 boost::signal<void (RosterItem*)> onDataChanged;
48 boost::signal<void (JID&)> onVCardUpdateRequested; 49 boost::signal<void (JID&)> onVCardUpdateRequested;