diff --git a/src/ui/display.hpp b/src/ui/display.hpp index 3cf06dc2bd3d262c645b99e687ed0bdadf2478e5..c47a80d3d58d8609753f2b5060ba4b1c23509fc8 100644 --- a/src/ui/display.hpp +++ b/src/ui/display.hpp @@ -15,7 +15,7 @@ namespace rmrf::ui { * It implements some basic information handling and a registry for * views. */ -class display { // : public std::enable_shared_from_this<display> { +class display : std::enable_shared_from_this<display> { public: typedef display self_type; typedef std::shared_ptr<self_type> ptr_type; @@ -34,7 +34,7 @@ public: decltype(auto) sync(F &&f, Args &&... args) { lock_type lock(m); - return std::forward<F>(f)(nullptr /*shared_from_this()*/, std::forward<Args>(args)...); + return std::forward<F>(f)(shared_from_this(), std::forward<Args>(args)...); } }; diff --git a/src/ui/progress_indicator.hpp b/src/ui/progress_indicator.hpp index 704b20e972ad2a06e4843b7e83e31bdecb5906de..62bec2216f58fc8b4451d250fa0ba7f5176ed188 100644 --- a/src/ui/progress_indicator.hpp +++ b/src/ui/progress_indicator.hpp @@ -10,7 +10,8 @@ namespace rmrf::ui { */ class progress_indicator { public: - virtual ~progress_indicator(); + progress_indicator() {}; + virtual ~progress_indicator() {}; /** * Query the progress state * @return The current progress in percent diff --git a/src/ui/ui_context.hpp b/src/ui/ui_context.hpp index be79b97384053f1c167d4e43014bfca9dfdaeb2f..4347bd9659351eca711fca3edc154689a3d90b56 100644 --- a/src/ui/ui_context.hpp +++ b/src/ui/ui_context.hpp @@ -11,6 +11,7 @@ namespace rmrf::ui { */ class ui_context { public: + ui_context() {}; virtual ~ui_context() {}; /** diff --git a/src/ui/view.cpp b/src/ui/view.cpp index 8128a309d64c2b156a8629d4ab071cec701e41f8..e4f10730a352935e1c70677823809b018de73b7e 100644 --- a/src/ui/view.cpp +++ b/src/ui/view.cpp @@ -7,7 +7,7 @@ namespace rmrf::ui { view::view(const std::shared_ptr<view> &parent) : parent_view{parent}, child_views{} { if (this->parent_view) { -// this->parent_view->add_child(this->shared_from_this()); + this->parent_view->add_child(this->shared_from_this()); } } @@ -17,7 +17,7 @@ view::~view() { // Notify our parent about us being destructed if (this->parent_view) { -// this->parent_view->remove_child(this->shared_from_this()); + this->parent_view->remove_child(this->shared_from_this()); } } diff --git a/src/ui/view.hpp b/src/ui/view.hpp index fff51ebffc4178c67addf9abfc42bbab29118130..8a5be5a0c811d58e9c54823b27e6add90fa4c4d4 100644 --- a/src/ui/view.hpp +++ b/src/ui/view.hpp @@ -14,7 +14,7 @@ namespace rmrf::ui { /** * This abstract class implements a view page. */ -class view : public ui_context { //, public std::enable_shared_from_this<view> { +class view : public ui_context, std::enable_shared_from_this<view> { private: std::shared_ptr<view> parent_view; std::list<std::shared_ptr<view>> child_views;