summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2016-08-25 14:00:10 (GMT)
committerTobias Markmann <tm@ayena.de>2016-08-25 14:12:34 (GMT)
commit5a4e7d9518e91cf39b96f14b3b310fe5b9a27594 (patch)
treede15882d3bb6f7b5e8230deada40ccc705a25c9c /Swift/QtUI/MUCSearch/MUCSearchRoomItem.h
parent5a19f3167b640966c582e52abe4b55ef20bd79b2 (diff)
downloadswift-5a4e7d9518e91cf39b96f14b3b310fe5b9a27594.zip
swift-5a4e7d9518e91cf39b96f14b3b310fe5b9a27594.tar.bz2
Alphabetically sort MUC search result
This also changes the classes around MUCSearchModel to C++11 smart pointer based memory management. Test-Information: Verified that dtors of MUCSearch*Items are called when old search results are replaced by new search results. This was not the case previously. All unit tests and manual testing with an ASAN enabled build succeeded. Change-Id: I84d62f3b86138728401b98d3774f47c72fdf9a4c
Diffstat (limited to 'Swift/QtUI/MUCSearch/MUCSearchRoomItem.h')
-rw-r--r--Swift/QtUI/MUCSearch/MUCSearchRoomItem.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/Swift/QtUI/MUCSearch/MUCSearchRoomItem.h b/Swift/QtUI/MUCSearch/MUCSearchRoomItem.h
index d2b88bc..281b555 100644
--- a/Swift/QtUI/MUCSearch/MUCSearchRoomItem.h
+++ b/Swift/QtUI/MUCSearch/MUCSearchRoomItem.h
@@ -6,18 +6,22 @@
#pragma once
+#include <memory>
+
#include <Swift/QtUI/MUCSearch/MUCSearchItem.h>
namespace Swift {
class MUCSearchServiceItem;
class MUCSearchRoomItem : public MUCSearchItem {
public:
- MUCSearchRoomItem(const QString& node, MUCSearchServiceItem* parent);
- MUCSearchServiceItem* getParent();
+ MUCSearchRoomItem(const QString& node);
+ void setParent(std::shared_ptr<MUCSearchServiceItem> parent);
+ std::shared_ptr<MUCSearchServiceItem> getParent();
QVariant data(int role);
QString getNode() const {return node_;}
+
private:
- MUCSearchServiceItem* parent_;
+ std::weak_ptr<MUCSearchServiceItem> parent_;
QString node_;
};
}