diff options
| author | Felix (xq) Queißner <git@mq32.de> | 2021-03-06 20:26:21 +0100 |
|---|---|---|
| committer | Felix (xq) Queißner <git@mq32.de> | 2021-03-06 20:29:50 +0100 |
| commit | 0396fdb01d12e51bd2cc63478819b366c0453d29 (patch) | |
| tree | 082fcd53b7b61c0dc2a0dc6b676729e155c07fd2 /src/favouritecollection.hpp | |
| parent | 21c821c49ef82d1e84b0b9c8c3d357dc559479d4 (diff) | |
| download | kristall-0396fdb01d12e51bd2cc63478819b366c0453d29.tar.gz | |
Moves all globals into a structure that can be deleted before the app exists. Fixes #193.
Diffstat (limited to 'src/favouritecollection.hpp')
| -rw-r--r-- | src/favouritecollection.hpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/favouritecollection.hpp b/src/favouritecollection.hpp index 9c18ec3..abc40b1 100644 --- a/src/favouritecollection.hpp +++ b/src/favouritecollection.hpp @@ -34,6 +34,8 @@ class FavouriteCollection : public QAbstractItemModel std::vector<std::unique_ptr<Node>> children; Type type; explicit Node(Type t) : type(t) { } + Node(Node const &) = delete; + Node(Node &&) = delete; virtual ~Node() = default; template<typename T> @@ -46,17 +48,23 @@ class FavouriteCollection : public QAbstractItemModel struct FavouriteNode : Node { ::Favourite favourite; FavouriteNode() : Node(Favourite) { } + FavouriteNode(FavouriteNode const &) = delete; + FavouriteNode(FavouriteNode &&) = delete; ~FavouriteNode() override = default; }; struct GroupNode : Node { QString title; GroupNode() : Node(Group) { } + GroupNode(GroupNode const &) = delete; + GroupNode(GroupNode &&) = delete; ~GroupNode() override = default; }; struct RootNode : Node { RootNode() : Node(Root) { } + RootNode(RootNode const &) = delete; + RootNode(RootNode &&) = delete; ~RootNode() override = default; }; @@ -65,6 +73,10 @@ public: FavouriteCollection(FavouriteCollection const & other); + FavouriteCollection(FavouriteCollection && other); + + ~FavouriteCollection(); + FavouriteCollection & operator=(FavouriteCollection const &); FavouriteCollection & operator=(FavouriteCollection &&); |
