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/graphlayout/graphlayout.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/graphlayout/graphlayout.cpp')
| -rw-r--r-- | src/graphlayout/graphlayout.cpp | 21 |
1 files changed, 6 insertions, 15 deletions
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<SPItem *>::iterator i(selected.begin()); i != selected.end(); |
