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/init.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/init.cpp')
| -rw-r--r-- | src/extension/init.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/extension/init.cpp b/src/extension/init.cpp index 940726df5..9a5aea86c 100644 --- a/src/extension/init.cpp +++ b/src/extension/init.cpp @@ -59,7 +59,7 @@ #ifdef WITH_LIBWPG #include "internal/wpg-input.h" #endif -#include "prefs-utils.h" +#include "preferences.h" #include "io/sys.h" #ifdef WITH_IMAGE_MAGICK @@ -127,7 +127,8 @@ static void update_pref(gchar const *pref_path, gchar const *pref_attr, gchar const *pref_default) // , GSList *extension_family) { - gchar const *pref = prefs_get_string_attribute(pref_path,pref_attr); + Inkscape::Preferences *prefs = Inkscape::Preferences::get(); + Glib::ustring pref = prefs->getString(pref_path, pref_attr); /* gboolean missing=TRUE; for (GSList *list = extension_family; list; list = g_slist_next(list)) { @@ -139,8 +140,8 @@ update_pref(gchar const *pref_path, gchar const *pref_attr, if (!strcmp(extension->get_id(),pref)) missing=FALSE; } */ - if (!Inkscape::Extension::db.get( pref ) /*missing*/) { - prefs_set_string_attribute(pref_path, pref_attr, pref_default); + if (!Inkscape::Extension::db.get( pref.data() ) /*missing*/) { + prefs->setString(pref_path, pref_attr, pref_default); } } @@ -154,6 +155,8 @@ update_pref(gchar const *pref_path, gchar const *pref_attr, void init() { + Inkscape::Preferences *prefs = Inkscape::Preferences::get(); + /* TODO: Change to Internal */ Internal::Svg::init(); Internal::Svgz::init(); @@ -161,7 +164,7 @@ init() //Internal::EpsOutput::init(); // disabled, to be deleted, replaced by CairoEpsOutput Internal::PrintPS::init(); #ifdef HAVE_CAIRO_PDF - if (prefs_get_int_attribute("options.useoldpdfexporter", "value", 1) == 1) { + if (prefs->getInt("options.useoldpdfexporter", "value", 1) == 1) { //g_print ("Using CairoPdfOutput: old pdf exporter\n"); Internal::CairoPdfOutput::init(); Internal::PrintCairoPDF::init(); |
