summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoanna Hulboj <joanna.hulboj@isode.com>2017-04-28 13:52:47 (GMT)
committerKevin Smith <kevin.smith@isode.com>2017-07-07 16:23:08 (GMT)
commitf68d574ff04162e98e16a636c66ab6de5960e875 (patch)
tree0248d9450a8bb6aa6731067d9f921791d9d4deaa /Swift/Controllers/Roster/Roster.cpp
parentd89b27b8796f89c847c280dacfb1b09fd6cb6731 (diff)
downloadswift-f68d574ff04162e98e16a636c66ab6de5960e875.zip
swift-f68d574ff04162e98e16a636c66ab6de5960e875.tar.bz2
Make std:: make_unique available in gcc with c++11
Test-Information: Unit tests pass OK on Windows 10 and CentOS 7.3. Change-Id: I33c9eb6b3e6409727350a44e6d5c88c5e8907275
Diffstat (limited to 'Swift/Controllers/Roster/Roster.cpp')
-rw-r--r--Swift/Controllers/Roster/Roster.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Swift/Controllers/Roster/Roster.cpp b/Swift/Controllers/Roster/Roster.cpp
index f6f6ce0..5b7e454 100644
--- a/Swift/Controllers/Roster/Roster.cpp
+++ b/Swift/Controllers/Roster/Roster.cpp
@@ -1,56 +1,56 @@
/*
* Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#include <Swift/Controllers/Roster/Roster.h>
#include <algorithm>
#include <deque>
#include <memory>
#include <set>
#include <string>
#include <boost/bind.hpp>
#include <Swiften/JID/JID.h>
#include <Swift/Controllers/Roster/ContactRosterItem.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) : fullJIDMapping_(fullJIDMapping), sortByStatus_(sortByStatus), root_(std::unique_ptr<GroupRosterItem>(new GroupRosterItem("Dummy-Root", nullptr, sortByStatus_))) {
+Roster::Roster(bool sortByStatus, bool fullJIDMapping) : fullJIDMapping_(fullJIDMapping), sortByStatus_(sortByStatus), root_(std::make_unique<GroupRosterItem>("Dummy-Root", nullptr, sortByStatus_)) {
root_->onChildrenChanged.connect(boost::bind(&Roster::handleChildrenChanged, this, root_.get()));
}
Roster::~Roster() {
std::deque<RosterItem*> queue;
while (!queue.empty()) {
RosterItem* item = *queue.begin();
queue.pop_front();
GroupRosterItem* group = dynamic_cast<GroupRosterItem*>(item);
if (group) {
queue.insert(queue.begin(), group->getChildren().begin(), group->getChildren().end());
}
ContactRosterItem* contact = dynamic_cast<ContactRosterItem*>(item);
if (contact) {
contact->onVCardRequested.disconnect(boost::bind(boost::ref(onVCardUpdateRequested), contact->getJID()));
}
delete item;
}
}
GroupRosterItem* Roster::getRoot() const {
return root_.get();
}
std::set<JID> Roster::getJIDs() const {
std::set<JID> jids;
std::deque<RosterItem*> queue;
queue.push_back(root_.get());
while (!queue.empty()) {