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/graphlayout/graphlayout.cpp | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) (limited to 'src/graphlayout/graphlayout.cpp') diff --git a/src/graphlayout/graphlayout.cpp b/src/graphlayout/graphlayout.cpp index 60cdab814..ef8eaa680 100644 --- a/src/graphlayout/graphlayout.cpp +++ b/src/graphlayout/graphlayout.cpp @@ -33,7 +33,7 @@ #include "libavoid/geomtypes.h" #include "libcola/cola.h" #include "libvpsc/generate-constraints.h" -#include "prefs-utils.h" +#include "preferences.h" using namespace std; using namespace cola; @@ -140,22 +140,13 @@ void graphlayout(GSList const *const items) { } } + Inkscape::Preferences *prefs = Inkscape::Preferences::get(); SimpleConstraints scx,scy; - double ideal_connector_length = prefs_get_double_attribute("tools.connector","length",100); + double ideal_connector_length = prefs->getDouble("tools.connector", "length", 100.0); double directed_edge_height_modifier = 1.0; - gchar const *directed_str = NULL, *overlaps_str = NULL; - directed_str = prefs_get_string_attribute("tools.connector", - "directedlayout"); - overlaps_str = prefs_get_string_attribute("tools.connector", - "avoidoverlaplayout"); - bool avoid_overlaps = false; - bool directed = false; - if (directed_str && !strcmp(directed_str, "true")) { - directed = true; - } - if (overlaps_str && !strcmp(overlaps_str, "true")) { - avoid_overlaps = true; - } + + bool directed = prefs->getBool("tools.connector", "directedlayout"); + bool avoid_overlaps = prefs->getBool("tools.connector", "avoidoverlaplayout"); for (list::iterator i(selected.begin()); i != selected.end(); -- cgit v1.2.3