From a3ed982da419cd49094106f3ea517198e07831d2 Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Wed, 3 May 2017 23:09:01 +0200 Subject: [PATCH] UI-top-level: fix GTK framework initialisation order --- src/gui/ctrl/ui-manager.cpp | 18 +++++++++++++----- src/gui/ctrl/ui-manager.hpp | 16 +++++++++++----- src/lib/psplay.c | 3 ++- 3 files changed, 26 insertions(+), 11 deletions(-) diff --git a/src/gui/ctrl/ui-manager.cpp b/src/gui/ctrl/ui-manager.cpp index dbc6a88e5..05e4e2ec8 100644 --- a/src/gui/ctrl/ui-manager.cpp +++ b/src/gui/ctrl/ui-manager.cpp @@ -66,6 +66,18 @@ namespace ctrl { { } + /** + * Initialise the GTK framework libraries + */ + ApplicationBase::ApplicationBase() + : Gtk::UIManager() + , gtkMain_(&argc, nullptr) + { + Glib::thread_init(); + Gdl::init(); + } + + /** * Initialise the interface globally on application start. * Setup the main application menu and bind the corresponding actions. @@ -73,15 +85,11 @@ namespace ctrl { * @see lumiera::Config */ UiManager::UiManager (UiBus& bus) - : Gtk::UIManager() + : ApplicationBase() , globals_{new GlobalCtx{bus, *this}} , actions_{new Actions{*globals_}} , styleManager_{new StyleManager{}} - , gtkMain_(&argc, nullptr) { - Glib::thread_init(); - Gdl::init(); - actions_->populateMainActions (*this); } diff --git a/src/gui/ctrl/ui-manager.hpp b/src/gui/ctrl/ui-manager.hpp index d0a3c092e..74b9ccd24 100644 --- a/src/gui/ctrl/ui-manager.hpp +++ b/src/gui/ctrl/ui-manager.hpp @@ -64,6 +64,16 @@ namespace ctrl { class Actions; + /** Framework initialisation base */ + class ApplicationBase + : public Gtk::UIManager + , boost::noncopyable + { + protected: + Gtk::Main gtkMain_; + ApplicationBase(); + }; + /** * Manage global concerns regarding a coherent user interface. @@ -72,17 +82,13 @@ namespace ctrl { * menu / command actions and to enter the top-level model parts. */ class UiManager - : public Gtk::UIManager - , boost::noncopyable + : public ApplicationBase { - unique_ptr globals_; unique_ptr actions_; unique_ptr styleManager_; - Gtk::Main gtkMain_; - public: /** * There is one global UiManager instance, diff --git a/src/lib/psplay.c b/src/lib/psplay.c index 478441f60..a6f0e32eb 100644 --- a/src/lib/psplay.c +++ b/src/lib/psplay.c @@ -290,7 +290,8 @@ psplay_insert (PSplay self, PSplaynode node, int splayfactor) } else { - TODO ("policy for multiple entered items (before, after, fail, replace)"); + WARN (psplay_dbg, "dropping duplicate entry for psplay"); + ///////////////////////////TODO policy for multiple entered items (before, after, fail, replace) return NULL; } }