From 192e8631d4c9a196e13a20d22f57c392bac9dd73 Mon Sep 17 00:00:00 2001 From: Tobias Markmann <tm@ayena.de> Date: Thu, 1 Oct 2015 11:01:41 +0100 Subject: Annotate getter method as const as it does not write anything Test-Information: Still builds and unit tests pass. Change-Id: I472491184ba10ec3bdbd4cb94613768639ac6f57 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,15 +1,14 @@ /* - * 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> @@ -17,9 +16,9 @@ #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 { @@ -48,7 +47,7 @@ Roster::~Roster() { } } -GroupRosterItem* Roster::getRoot() { +GroupRosterItem* Roster::getRoot() const { return root_; } 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,23 +1,24 @@ /* - * 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 { @@ -40,7 +41,7 @@ class Roster { 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; -- cgit v0.10.2-6-g49f6