summaryrefslogtreecommitdiffstats
blob: 9c3ef2c231981a24b573f379a4636d293a5a1c05 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/*
 * Copyright (c) 2010-2016 Isode Limited.
 * All rights reserved.
 * See the COPYING file for more information.
 */

#include <Swift/QtUI/MUCSearch/MUCSearchRoomItem.h>

#include <memory>

#include <Swift/QtUI/MUCSearch/MUCSearchServiceItem.h>

namespace Swift {

MUCSearchRoomItem::MUCSearchRoomItem(const QString& node) : node_(node) {

}

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();
    }
}

}