diff options
| author | Krzysztof Kosi??ski <tweenk.pl@gmail.com> | 2008-09-16 17:15:22 +0000 |
|---|---|---|
| committer | tweenk <tweenk@users.sourceforge.net> | 2008-09-16 17:15:22 +0000 |
| commit | 9d87d30b72145fdee954992a9dc70f8c60174d7d (patch) | |
| tree | 194a94ece6ed668ad7dc529de2cdd09b7565c6fe /src/extension/param/enum.cpp | |
| parent | fix leak of the arena and arenaitem (diff) | |
| download | inkscape-9d87d30b72145fdee954992a9dc70f8c60174d7d.tar.gz inkscape-9d87d30b72145fdee954992a9dc70f8c60174d7d.zip | |
Refactored preferences handling into a new version of
the Inkscape::Preferences class. Removed all use of
prefs_get_string_attribute(), pref_path_get_nth_child() and
create_pref() in favor of the new API. Replaced some "0 or 1" integer
preferences with booleans.
(bzr r6823)
Diffstat (limited to 'src/extension/param/enum.cpp')
| -rw-r--r-- | src/extension/param/enum.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/extension/param/enum.cpp b/src/extension/param/enum.cpp index 89db25d03..33c153434 100644 --- a/src/extension/param/enum.cpp +++ b/src/extension/param/enum.cpp @@ -33,6 +33,7 @@ #include <sp-object.h> #include "enum.h" +#include "preferences.h" /** \brief The root directory in the preferences database for extension related parameters. */ @@ -104,13 +105,14 @@ ParamComboBox::ParamComboBox (const gchar * name, const gchar * guitext, const g defaultval = sp_repr_children(xml)->attribute("value"); gchar * pref_name = this->pref_name(); - const gchar * paramval = prefs_get_string_attribute(PREF_DIR, pref_name); + Inkscape::Preferences *prefs = Inkscape::Preferences::get(); + Glib::ustring paramval = prefs->getString(PREF_DIR, pref_name); g_free(pref_name); - if (paramval != NULL) - defaultval = paramval; + if (!paramval.empty()) + defaultval = paramval.data(); if (defaultval != NULL) - _value = g_strdup(defaultval); // allocate space for _value + _value = g_strdup(defaultval); return; } @@ -157,7 +159,8 @@ ParamComboBox::set (const gchar * in, SPDocument * /*doc*/, Inkscape::XML::Node if (_value != NULL) g_free(_value); _value = g_strdup(settext->c_str()); gchar * prefname = this->pref_name(); - prefs_set_string_attribute(PREF_DIR, prefname, _value); + Inkscape::Preferences *prefs = Inkscape::Preferences::get(); + prefs->setString(PREF_DIR, prefname, _value); g_free(prefname); } |
