diff options
Diffstat (limited to 'Swift/QtUI/MUCSearch/MUCSearchRoomItem.cpp')
-rw-r--r-- | Swift/QtUI/MUCSearch/MUCSearchRoomItem.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/Swift/QtUI/MUCSearch/MUCSearchRoomItem.cpp b/Swift/QtUI/MUCSearch/MUCSearchRoomItem.cpp index cb7ee2d..3b786b6 100644 --- a/Swift/QtUI/MUCSearch/MUCSearchRoomItem.cpp +++ b/Swift/QtUI/MUCSearch/MUCSearchRoomItem.cpp @@ -6,16 +6,24 @@ #include <Swift/QtUI/MUCSearch/MUCSearchRoomItem.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::shared_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_); |