From 34a1f9ad048c2aec2149e0bdaca5e66fca8de442 Mon Sep 17 00:00:00 2001 From: Eduard Braun Date: Sun, 9 Apr 2017 15:20:24 +0200 Subject: Remove unused field "gui_tip" ("gui_description" does now what "gui_tip" was supposed to do) (bzr r15633.1.1) --- src/extension/param/notebook.cpp | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'src/extension/param/notebook.cpp') diff --git a/src/extension/param/notebook.cpp b/src/extension/param/notebook.cpp index de86d1005..2e216e967 100644 --- a/src/extension/param/notebook.cpp +++ b/src/extension/param/notebook.cpp @@ -59,7 +59,6 @@ public: const gchar * desc, const Parameter::_scope_t scope, bool gui_hidden, - const gchar * gui_tip, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml); ~ParamNotebookPage(void); @@ -76,10 +75,9 @@ ParamNotebookPage::ParamNotebookPage(const gchar * name, const gchar * desc, const Parameter::_scope_t scope, bool gui_hidden, - const gchar * gui_tip, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml) - : Parameter(name, guitext, desc, scope, gui_hidden, gui_tip, /*indent*/ 0, ext) + : Parameter(name, guitext, desc, scope, gui_hidden, /*indent*/ 0, ext) { parameters = NULL; @@ -157,15 +155,11 @@ ParamNotebookPage::makepage (Inkscape::XML::Node * in_repr, Inkscape::Extension: Parameter::_scope_t scope = Parameter::SCOPE_USER; bool gui_hidden = false; const char * gui_hide; - const char * gui_tip; name = in_repr->attribute("name"); guitext = in_repr->attribute("gui-text"); if (guitext == NULL) guitext = in_repr->attribute("_gui-text"); - gui_tip = in_repr->attribute("gui-tip"); - if (gui_tip == NULL) - gui_tip = in_repr->attribute("_gui-tip"); desc = in_repr->attribute("gui-description"); if (desc == NULL) desc = in_repr->attribute("_gui-description"); @@ -194,7 +188,7 @@ ParamNotebookPage::makepage (Inkscape::XML::Node * in_repr, Inkscape::Extension: } } - ParamNotebookPage * page = new ParamNotebookPage(name, guitext, desc, scope, gui_hidden, gui_tip, in_ext, in_repr); + ParamNotebookPage * page = new ParamNotebookPage(name, guitext, desc, scope, gui_hidden, in_ext, in_repr); /* Note: page could equal NULL */ return page; @@ -251,11 +245,10 @@ ParamNotebook::ParamNotebook(const gchar * name, const gchar * desc, const Parameter::_scope_t scope, bool gui_hidden, - const gchar * gui_tip, int indent, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml) - : Parameter(name, guitext, desc, scope, gui_hidden, gui_tip, indent, ext) + : Parameter(name, guitext, desc, scope, gui_hidden, indent, ext) { pages = NULL; -- cgit v1.2.3 From f0ad38f6fd0d18f48d92df4b55ff8352747e6b2c Mon Sep 17 00:00:00 2001 From: Eduard Braun Date: Sun, 9 Apr 2017 15:39:40 +0200 Subject: Remove unused field "scope" (bzr r15633.1.2) --- src/extension/param/notebook.cpp | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) (limited to 'src/extension/param/notebook.cpp') diff --git a/src/extension/param/notebook.cpp b/src/extension/param/notebook.cpp index 2e216e967..c61733d26 100644 --- a/src/extension/param/notebook.cpp +++ b/src/extension/param/notebook.cpp @@ -57,7 +57,6 @@ public: ParamNotebookPage(const gchar * name, const gchar * guitext, const gchar * desc, - const Parameter::_scope_t scope, bool gui_hidden, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml); @@ -73,11 +72,10 @@ public: ParamNotebookPage::ParamNotebookPage(const gchar * name, const gchar * guitext, const gchar * desc, - const Parameter::_scope_t scope, bool gui_hidden, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml) - : Parameter(name, guitext, desc, scope, gui_hidden, /*indent*/ 0, ext) + : Parameter(name, guitext, desc, gui_hidden, /*indent*/ 0, ext) { parameters = NULL; @@ -151,8 +149,6 @@ ParamNotebookPage::makepage (Inkscape::XML::Node * in_repr, Inkscape::Extension: const char * name; const char * guitext; const char * desc; - const char * scope_str; - Parameter::_scope_t scope = Parameter::SCOPE_USER; bool gui_hidden = false; const char * gui_hide; @@ -163,7 +159,6 @@ ParamNotebookPage::makepage (Inkscape::XML::Node * in_repr, Inkscape::Extension: desc = in_repr->attribute("gui-description"); if (desc == NULL) desc = in_repr->attribute("_gui-description"); - scope_str = in_repr->attribute("scope"); gui_hide = in_repr->attribute("gui-hidden"); if (gui_hide != NULL) { if (strcmp(gui_hide, "1") == 0 || @@ -178,17 +173,7 @@ ParamNotebookPage::makepage (Inkscape::XML::Node * in_repr, Inkscape::Extension: return NULL; } - if (scope_str != NULL) { - if (!strcmp(scope_str, "user")) { - scope = Parameter::SCOPE_USER; - } else if (!strcmp(scope_str, "document")) { - scope = Parameter::SCOPE_DOCUMENT; - } else if (!strcmp(scope_str, "node")) { - scope = Parameter::SCOPE_NODE; - } - } - - ParamNotebookPage * page = new ParamNotebookPage(name, guitext, desc, scope, gui_hidden, in_ext, in_repr); + ParamNotebookPage * page = new ParamNotebookPage(name, guitext, desc, gui_hidden, in_ext, in_repr); /* Note: page could equal NULL */ return page; @@ -243,12 +228,11 @@ Gtk::Widget * ParamNotebookPage::get_widget(SPDocument * doc, Inkscape::XML::Nod ParamNotebook::ParamNotebook(const gchar * name, const gchar * guitext, const gchar * desc, - const Parameter::_scope_t scope, bool gui_hidden, int indent, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml) - : Parameter(name, guitext, desc, scope, gui_hidden, indent, ext) + : Parameter(name, guitext, desc, gui_hidden, indent, ext) { pages = NULL; -- cgit v1.2.3 From bc1ecf9dd11d0b3bb6939114ce6aec229fc86548 Mon Sep 17 00:00:00 2001 From: Eduard Braun Date: Sun, 9 Apr 2017 16:46:33 +0200 Subject: Some code refactoring for consistency (notably "gui_hidden" -> hidden", "guitext" -> "text", "desc" -> "description") (bzr r15633.1.3) --- src/extension/param/notebook.cpp | 62 ++++++++++++++++++++-------------------- 1 file changed, 31 insertions(+), 31 deletions(-) (limited to 'src/extension/param/notebook.cpp') diff --git a/src/extension/param/notebook.cpp b/src/extension/param/notebook.cpp index c61733d26..a31dda421 100644 --- a/src/extension/param/notebook.cpp +++ b/src/extension/param/notebook.cpp @@ -55,27 +55,27 @@ public: static ParamNotebookPage * makepage (Inkscape::XML::Node * in_repr, Inkscape::Extension::Extension * in_ext); ParamNotebookPage(const gchar * name, - const gchar * guitext, - const gchar * desc, - bool gui_hidden, + const gchar * text, + const gchar * description, + bool hidden, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml); ~ParamNotebookPage(void); Gtk::Widget * get_widget(SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal); void paramString (std::list &list); - gchar * get_guitext (void) {return _text;}; + gchar * get_text (void) {return _text;}; Parameter * get_param (const gchar * name); }; /* class ParamNotebookPage */ ParamNotebookPage::ParamNotebookPage(const gchar * name, - const gchar * guitext, - const gchar * desc, - bool gui_hidden, + const gchar * text, + const gchar * description, + bool hidden, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml) - : Parameter(name, guitext, desc, gui_hidden, /*indent*/ 0, ext) + : Parameter(name, text, description, hidden, /*indent*/ 0, ext) { parameters = NULL; @@ -147,23 +147,23 @@ ParamNotebookPage * ParamNotebookPage::makepage (Inkscape::XML::Node * in_repr, Inkscape::Extension::Extension * in_ext) { const char * name; - const char * guitext; - const char * desc; - bool gui_hidden = false; - const char * gui_hide; + const char * text; + const char * description; + bool hidden = false; + const char * hide; name = in_repr->attribute("name"); - guitext = in_repr->attribute("gui-text"); - if (guitext == NULL) - guitext = in_repr->attribute("_gui-text"); - desc = in_repr->attribute("gui-description"); - if (desc == NULL) - desc = in_repr->attribute("_gui-description"); - gui_hide = in_repr->attribute("gui-hidden"); - if (gui_hide != NULL) { - if (strcmp(gui_hide, "1") == 0 || - strcmp(gui_hide, "true") == 0) { - gui_hidden = true; + text = in_repr->attribute("gui-text"); + if (text == NULL) + text = in_repr->attribute("_gui-text"); + description = in_repr->attribute("gui-description"); + if (description == NULL) + description = in_repr->attribute("_gui-description"); + hide = in_repr->attribute("gui-hidden"); + if (hide != NULL) { + if (strcmp(hide, "1") == 0 || + strcmp(hide, "true") == 0) { + hidden = true; } /* else stays false */ } @@ -173,7 +173,7 @@ ParamNotebookPage::makepage (Inkscape::XML::Node * in_repr, Inkscape::Extension: return NULL; } - ParamNotebookPage * page = new ParamNotebookPage(name, guitext, desc, gui_hidden, in_ext, in_repr); + ParamNotebookPage * page = new ParamNotebookPage(name, text, description, hidden, in_ext, in_repr); /* Note: page could equal NULL */ return page; @@ -188,7 +188,7 @@ ParamNotebookPage::makepage (Inkscape::XML::Node * in_repr, Inkscape::Extension: */ Gtk::Widget * ParamNotebookPage::get_widget(SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) { - if (_gui_hidden) { + if (_hidden) { return NULL; } @@ -226,13 +226,13 @@ Gtk::Widget * ParamNotebookPage::get_widget(SPDocument * doc, Inkscape::XML::Nod ParamNotebook::ParamNotebook(const gchar * name, - const gchar * guitext, - const gchar * desc, - bool gui_hidden, + const gchar * text, + const gchar * description, + bool hidden, int indent, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml) - : Parameter(name, guitext, desc, gui_hidden, indent, ext) + : Parameter(name, text, description, hidden, indent, ext) { pages = NULL; @@ -423,7 +423,7 @@ Parameter *ParamNotebookPage::get_param(const gchar * name) */ Gtk::Widget * ParamNotebook::get_widget(SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) { - if (_gui_hidden) { + if (_hidden) { return NULL; } @@ -436,7 +436,7 @@ Gtk::Widget * ParamNotebook::get_widget(SPDocument * doc, Inkscape::XML::Node * i++; ParamNotebookPage * page = reinterpret_cast(list->data); Gtk::Widget * widg = page->get_widget(doc, node, changeSignal); - nb->append_page(*widg, _(page->get_guitext())); + nb->append_page(*widg, _(page->get_text())); if (!strcmp(_value, page->name())) { pagenr = i; // this is the page to be displayed? } -- cgit v1.2.3