From c8b6e7a699294b6da0b6993c73530bc96f2b9448 Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Wed, 26 Oct 2016 18:27:22 +0200 Subject: [PATCH] mark some code smells (#1026) --- src/gui/panel/panel.cpp | 2 + src/gui/workspace/panel-manager.cpp | 4 + src/gui/workspace/panel-manager.hpp | 7 +- wiki/thinkPad.ichthyo.mm | 149 ++++++++++++++++++++++++++++ 4 files changed, 159 insertions(+), 3 deletions(-) diff --git a/src/gui/panel/panel.cpp b/src/gui/panel/panel.cpp index d3c50a09c..f58760556 100644 --- a/src/gui/panel/panel.cpp +++ b/src/gui/panel/panel.cpp @@ -48,6 +48,7 @@ namespace panel{ g_object_set_property (G_OBJECT (dockItem.gobj()), "long-name", val.gobj()); /* Set the grip handle */ + ///////////////////////////////////////////////////////TICKET #1027 : find out how to do this with gdlmm (C++ binding). No direct usage of GDL ! GdlDockItemGrip *grip = GDL_DOCK_ITEM_GRIP( gdl_dock_item_get_grip(dockItem.gobj())); gdl_dock_item_grip_show_handle(grip); @@ -73,6 +74,7 @@ namespace panel{ #if false /////////////////////////////////////////////////TICKET #937 : disabled for GTK-3 transition. TODO investigate why this logic existed... /* Detach the panel bar */ + ///////////////////////////////////////////////////////TICKET #1027 !! GdlDockItemGrip *grip = GDL_DOCK_ITEM_GRIP( gdl_dock_item_get_grip(dockItem_.gobj())); gtk_container_remove (GTK_CONTAINER(grip), diff --git a/src/gui/workspace/panel-manager.cpp b/src/gui/workspace/panel-manager.cpp index 873780aed..c75a02224 100644 --- a/src/gui/workspace/panel-manager.cpp +++ b/src/gui/workspace/panel-manager.cpp @@ -71,6 +71,7 @@ namespace workspace { ///////////////////////////////////////////////////////TICKET #172 : observed as a reason for crashes when closing the GUI. It was invoked after end of main, when the GUI as already gone. #if false ///////////////////////////////////////////////////TICKET #937 : disabled for GTK-3 transition. TODO investigate why this logic existed... + ///////////////////////////////////////////////////////TICKET #1027 for(int i = 0; i < 4; i++) if(dockPlaceholders_[i]) g_object_unref(dockPlaceholders_[i]); @@ -84,6 +85,8 @@ namespace workspace { void PanelManager::setupDock() { + ///////////////////////////////////////////////////////TICKET #1027 : investigate what would be the proper way to do this with gdlmm (C++ binding). No direct usage of GDL ! + REQUIRE(dockPlaceholders_[0] == NULL && dockPlaceholders_[1] == NULL && dockPlaceholders_[2] == NULL && dockPlaceholders_[3] == NULL); dockPlaceholders_[0] = GDL_DOCK_PLACEHOLDER(gdl_dock_placeholder_new( @@ -223,6 +226,7 @@ namespace workspace { void PanelManager::createPanels() { + ///////////////////////////////TICKET #1026 : code smell, use types directly instead panel::Panel* assetsPanel = createPanel_by_name("AssetsPanel"); panel::Panel* viewerPanel = createPanel_by_name("ViewerPanel"); panel::Panel* timelinePanel = createPanel_by_name("TimelinePanel"); diff --git a/src/gui/workspace/panel-manager.hpp b/src/gui/workspace/panel-manager.hpp index f0ccd549f..ba383ab09 100644 --- a/src/gui/workspace/panel-manager.hpp +++ b/src/gui/workspace/panel-manager.hpp @@ -44,6 +44,7 @@ namespace workspace { /** * A class to manage DockItem objects for WorkspaceWindow. + * @todo this code is smelly and needs some clean-up ///////////////////////////////TICKET #1026 */ class PanelManager { @@ -91,7 +92,7 @@ namespace workspace { /** * Gets a pointer to the dock object. - * @remarks Note that this must not be called before setup_dock. + * @remarks Note that this must not be called before setup_dock. ///////////////////////////////TICKET #1026 : code smell */ Gdl::Dock& getDock(); @@ -104,7 +105,7 @@ namespace workspace { /** * Returns a reference to the owner workspace window. */ - WorkspaceWindow& getWorkspaceWindow(); + WorkspaceWindow& getWorkspaceWindow(); ///////////////////////////////TICKET #1026 : code smell, unclear dependency relation /** * Shows a panel given a description index. @@ -218,7 +219,7 @@ namespace workspace { { protected: typedef panel::Panel* (*const CreatePanelProc)(PanelManager&, Gdl::DockItem&); - + ///////////////////////////////TICKET #1026 : code smell, why not just using inheritance? private: /** reference to the typeID of this class */ const std::type_info& classInfo_; diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm index 2761d68d4..ea7fef465 100644 --- a/wiki/thinkPad.ichthyo.mm +++ b/wiki/thinkPad.ichthyo.mm @@ -26,6 +26,155 @@ + + + + + + + + + + + + +

+ ...nur enabled wenn +

+

+ mehr als ein top-level Fenster offen +

+ + +
+
+
+ + + + + + + + + + + + +

+ A Gtk::UIManager constructs a user interface (menus and toolbars) from one or more UI definitions, +

+

+ which reference actions from one or more action groups. +

+ + +
+
+ + + + + + + + + + + + + +

+ realisiert Vererbung zu fuß +

+ + +
+ + + + + +

+ ...anstatt eine auf den konkreten Typ getemplatete Subklasse zu verwenden, +

+

+ wird eine "CreatePanelProc" in einen PanelDescriptor eingewickelt. +

+

+ Letzten Endes wird dieser dann per Match auf die Typ-ID ausgewählt. +

+

+ AUA! +

+ + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +

+ Helper to build the menu and for registering and handling of user action events +

+ + +
+
+
+ + + + + + + + + + + + + + + + +

+ es sieht so aus, als wäre es "das" WorkspaceWindow +

+

+ aber es kann davon mehrere geben +

+ + +
+
+ + +
+