From 0396fdb01d12e51bd2cc63478819b366c0453d29 Mon Sep 17 00:00:00 2001 From: "Felix (xq) Queißner" Date: Sat, 6 Mar 2021 20:26:21 +0100 Subject: Moves all globals into a structure that can be deleted before the app exists. Fixes #193. --- src/favouritecollection.hpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/favouritecollection.hpp') 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> children; Type type; explicit Node(Type t) : type(t) { } + Node(Node const &) = delete; + Node(Node &&) = delete; virtual ~Node() = default; template @@ -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 &&); -- cgit v1.2.3