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/dialogs/swatches.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/dialogs/swatches.cpp')
| -rw-r--r-- | src/dialogs/swatches.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/dialogs/swatches.cpp b/src/dialogs/swatches.cpp index 21889179f..5d76cc8f6 100644 --- a/src/dialogs/swatches.cpp +++ b/src/dialogs/swatches.cpp @@ -37,7 +37,7 @@ #include "path-prefix.h" #include "swatches.h" #include "sp-item.h" -#include "prefs-utils.h" +#include "preferences.h" #include "eek-preview.h" @@ -1046,10 +1046,11 @@ SwatchesPanel::SwatchesPanel(gchar const* prefsPath) : if ( !possible.empty() ) { JustForNow* first = 0; - gchar const* targetName = 0; + Glib::ustring targetName; if ( _prefs_path ) { - targetName = prefs_get_string_attribute( _prefs_path, "palette" ); - if ( targetName ) { + Inkscape::Preferences *prefs = Inkscape::Preferences::get(); + targetName = prefs->getString(_prefs_path, "palette"); + if (!targetName.empty()) { for ( std::vector<JustForNow*>::iterator iter = possible.begin(); iter != possible.end(); ++iter ) { if ( (*iter)->_name == targetName ) { first = *iter; @@ -1123,7 +1124,8 @@ void SwatchesPanel::_handleAction( int setId, int itemId ) JustForNow* curr = possible[itemId]; if ( _prefs_path ) { - prefs_set_string_attribute( _prefs_path, "palette", curr->_name.c_str() ); + Inkscape::Preferences *prefs = Inkscape::Preferences::get(); + prefs->setString(_prefs_path, "palette", curr->_name); } if ( curr->_prefWidth > 0 ) { |
