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/box3d-side.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/box3d-side.cpp')
| -rw-r--r-- | src/box3d-side.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/box3d-side.cpp b/src/box3d-side.cpp index 0086d1101..cdeb001eb 100644 --- a/src/box3d-side.cpp +++ b/src/box3d-side.cpp @@ -21,7 +21,7 @@ #include "inkscape.h" #include "persp3d.h" #include "box3d-context.h" -#include "prefs-utils.h" +#include "preferences.h" #include "desktop-style.h" #include "box3d.h" @@ -239,16 +239,17 @@ box3d_side_set_shape (SPShape *shape) void box3d_side_apply_style (Box3DSide *side) { Inkscape::XML::Node *repr_face = SP_OBJECT_REPR(SP_OBJECT(side)); + Inkscape::Preferences *prefs = Inkscape::Preferences::get(); - gchar *descr = g_strconcat ("desktop.", box3d_side_axes_string (side), NULL); - const gchar * cur_style = prefs_get_string_attribute(descr, "style"); - g_free (descr); + Glib::ustring descr = "desktop."; + descr += box3d_side_axes_string(side); + Glib::ustring cur_style = prefs->getString(descr, "style"); SPDesktop *desktop = inkscape_active_desktop(); - bool use_current = prefs_get_int_attribute("tools.shapes.3dbox", "usecurrent", 0); - if (use_current && cur_style !=NULL) { + bool use_current = prefs->getBool("tools.shapes.3dbox", "usecurrent", false); + if (use_current && !cur_style.empty()) { /* use last used style */ - repr_face->setAttribute("style", cur_style); + repr_face->setAttribute("style", cur_style.data()); } else { /* use default style */ GString *pstring = g_string_new(""); |
