From 9d87d30b72145fdee954992a9dc70f8c60174d7d Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Tue, 16 Sep 2008 17:15:22 +0000 Subject: 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) --- src/ui/context-menu.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/ui/context-menu.cpp') diff --git a/src/ui/context-menu.cpp b/src/ui/context-menu.cpp index e2ce5a2e1..51b4b3f43 100644 --- a/src/ui/context-menu.cpp +++ b/src/ui/context-menu.cpp @@ -18,7 +18,7 @@ #include "desktop.h" #include "document.h" #include "message-stack.h" -#include "prefs-utils.h" +#include "preferences.h" #include "ui/dialog/dialog-manager.h" static void sp_object_type_menu(GType type, SPObject *object, SPDesktop *desktop, GtkMenu *menu); @@ -316,13 +316,14 @@ sp_image_image_properties(GtkMenuItem */*menuitem*/, SPAnchor *anchor) } static gchar* getImageEditorName() { + Inkscape::Preferences *prefs = Inkscape::Preferences::get(); gchar* value = 0; - gchar const *choices = prefs_get_string_attribute("options.bitmapeditor", "choices"); - if ( choices && choices[0] ) { - gchar** splits = g_strsplit(choices, ",", 0); + Glib::ustring choices = prefs->getString("options.bitmapeditor", "choices"); + if (!choices.empty()) { + gchar** splits = g_strsplit(choices.data(), ",", 0); gint numIems = g_strv_length(splits); - int setting = prefs_get_int_attribute_limited("options.bitmapeditor", "value", 0, 0, numIems); + int setting = prefs->getIntLimited("options.bitmapeditor", "value", 0, 0, numIems); value = g_strdup(splits[setting]); g_strfreev(splits); -- cgit v1.2.3