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/MUCSearchEmptyItem.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/MUCSearchEmptyItem.h')
-rw-r--r--Swift/QtUI/MUCSearch/MUCSearchEmptyItem.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/Swift/QtUI/MUCSearch/MUCSearchEmptyItem.h b/Swift/QtUI/MUCSearch/MUCSearchEmptyItem.h
index ca4b2b2..06c7c4e 100644
--- a/Swift/QtUI/MUCSearch/MUCSearchEmptyItem.h
+++ b/Swift/QtUI/MUCSearch/MUCSearchEmptyItem.h
@@ -1,11 +1,13 @@
/*
- * Copyright (c) 2010 Isode Limited.
+ * Copyright (c) 2010-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
+#include <memory>
+
#include <Swift/QtUI/MUCSearch/MUCSearchItem.h>
namespace Swift {
@@ -13,13 +15,14 @@ namespace Swift {
class MUCSearchEmptyItem : public MUCSearchItem {
public:
- MUCSearchEmptyItem(MUCSearchServiceItem* parent);
+ MUCSearchEmptyItem();
- MUCSearchServiceItem* getParent();
+ void setParent(std::shared_ptr<MUCSearchServiceItem> parent);
+ std::shared_ptr<MUCSearchServiceItem> getParent();
QVariant data(int role);
private:
- MUCSearchServiceItem* parent;
+ std::weak_ptr<MUCSearchServiceItem> parent_;
};
}