diff options
Diffstat (limited to 'Swift/QtUI/MUCSearch/MUCSearchRoomItem.cpp')
-rw-r--r-- | Swift/QtUI/MUCSearch/MUCSearchRoomItem.cpp | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/Swift/QtUI/MUCSearch/MUCSearchRoomItem.cpp b/Swift/QtUI/MUCSearch/MUCSearchRoomItem.cpp index a8c7bbe..9c3ef2c 100644 --- a/Swift/QtUI/MUCSearch/MUCSearchRoomItem.cpp +++ b/Swift/QtUI/MUCSearch/MUCSearchRoomItem.cpp @@ -1,26 +1,34 @@ /* - * Copyright (c) 2010 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ -#include "Swift/QtUI/MUCSearch/MUCSearchRoomItem.h" +#include <Swift/QtUI/MUCSearch/MUCSearchRoomItem.h> -#include "Swift/QtUI/MUCSearch/MUCSearchServiceItem.h" +#include <memory> + +#include <Swift/QtUI/MUCSearch/MUCSearchServiceItem.h> namespace Swift { -MUCSearchRoomItem::MUCSearchRoomItem(const QString& node, MUCSearchServiceItem* parent) : parent_(parent), node_(node) { - parent_->addRoom(this); + +MUCSearchRoomItem::MUCSearchRoomItem(const QString& node) : node_(node) { + } -MUCSearchServiceItem* MUCSearchRoomItem::getParent() { - return parent_; +void MUCSearchRoomItem::setParent(std::weak_ptr<MUCSearchServiceItem> parent) { + parent_ = parent; } + +std::shared_ptr<MUCSearchServiceItem> MUCSearchRoomItem::getParent() { + return parent_.lock(); +} + QVariant MUCSearchRoomItem::data(int role) { - switch (role) { - case Qt::DisplayRole: return QVariant(node_); - default: return QVariant(); - } + switch (role) { + case Qt::DisplayRole: return QVariant(node_); + default: return QVariant(); + } } } |