summaryrefslogtreecommitdiffstats
path: root/src/extension/prefdialog/parameter-notebook.cpp
diff options
context:
space:
mode:
authorPatrick Storz <eduard.braun2@gmx.de>2019-08-05 22:11:54 +0000
committerPatrick Storz <eduard.braun2@gmx.de>2019-08-31 14:50:39 +0000
commit26d8a32b7395d7bf1d1da7c32b9f2cdf5770510a (patch)
tree904840fe91cd40cc5791e35ff9435d8e403478df /src/extension/prefdialog/parameter-notebook.cpp
parentInxParameter::string(): remove useless overrides (diff)
downloadinkscape-26d8a32b7395d7bf1d1da7c32b9f2cdf5770510a.tar.gz
inkscape-26d8a32b7395d7bf1d1da7c32b9f2cdf5770510a.zip
Optimize parameter string generation
Also rename overloaded string() functions, so it's clear what they actually do, as it's not the same thing at all...
Diffstat (limited to 'src/extension/prefdialog/parameter-notebook.cpp')
-rw-r--r--src/extension/prefdialog/parameter-notebook.cpp33
1 files changed, 13 insertions, 20 deletions
diff --git a/src/extension/prefdialog/parameter-notebook.cpp b/src/extension/prefdialog/parameter-notebook.cpp
index e84150aa2..50c21b3eb 100644
--- a/src/extension/prefdialog/parameter-notebook.cpp
+++ b/src/extension/prefdialog/parameter-notebook.cpp
@@ -24,13 +24,6 @@
#include "xml/node.h"
-
-/**
- * The root directory in the preferences database for extension
- * related parameters.
- */
-#define PREF_DIR "extensions"
-
namespace Inkscape {
namespace Extension {
@@ -70,10 +63,10 @@ ParamNotebook::ParamNotebookPage::~ParamNotebookPage ()
}
}
-void ParamNotebook::ParamNotebookPage::string(std::list <std::string> &list) const
+void ParamNotebook::ParamNotebookPage::build_param_string_list(std::list <std::string> &list) const
{
for (auto parameter : parameters) {
- parameter->string(list);
+ parameter->build_param_string_list(list);
}
}
@@ -209,23 +202,23 @@ const Glib::ustring& ParamNotebook::set(const int in, SPDocument * /*doc*/, Inks
return _value;
}
-void ParamNotebook::string(std::list <std::string> &list) const
+void ParamNotebook::build_param_string_list(std::list <std::string> &list) const
{
- std::string param_string;
- param_string += "--";
- param_string += _name;
- param_string += "=";
-
- param_string += "\"";
- param_string += _value; // the name of the current page
- param_string += "\"";
- list.insert(list.end(), param_string);
+ // call base-class method to add the parameter string for the notebook itself
+ InxParameter::build_param_string_list(list);
+ // iterate over notebook pages
for (auto page : pages) {
- page->string(list);
+ page->build_param_string_list(list);
}
}
+std::string ParamNotebook::value_to_string() const
+{
+ return _value;
+}
+
+
/** A special category of Gtk::Notebook to handle notebook parameters. */
class NotebookWidget : public Gtk::Notebook {
private: