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/ui/clipboard.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/ui/clipboard.cpp')
| -rw-r--r-- | src/ui/clipboard.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/ui/clipboard.cpp b/src/ui/clipboard.cpp index cad6fa011..7bdb55d00 100644 --- a/src/ui/clipboard.cpp +++ b/src/ui/clipboard.cpp @@ -69,7 +69,7 @@ #include "svg/svg.h" // for sp_svg_transform_write, used in _copySelection #include "svg/css-ostringstream.h" // used in _parseColor #include "file.h" // for file_import, used in _pasteImage -#include "prefs-utils.h" // for prefs_get_string_attribute, used in _pasteImage +#include "preferences.h" // for used in _pasteImage #include "text-context.h" #include "text-editing.h" #include "tools-switch.h" @@ -270,7 +270,7 @@ bool ClipboardManagerImpl::paste(bool in_place) Glib::ustring target = _getBestTarget(); - // Special cases of clipboard content handling go here 00ff00 + // Special cases of clipboard content handling go here // Note that target priority is determined in _getBestTarget. // TODO: Handle x-special/gnome-copied-files and text/uri-list to support pasting files @@ -858,13 +858,14 @@ bool ClipboardManagerImpl::_pasteImage() // in 1 second. time_t rawtime; char image_filename[128]; - gchar const *save_folder; time(&rawtime); strftime(image_filename, 128, "inkscape_pasted_image_%Y%m%d_%H%M%S.png", localtime( &rawtime )); - save_folder = (gchar const *) prefs_get_string_attribute("dialogs.save_as", "path"); + /// @todo Check whether the encoding is correct here + Inkscape::Preferences *prefs = Inkscape::Preferences::get(); + std::string save_folder = Glib::filename_from_utf8(prefs->getString("dialogs.save_as", "path")); - gchar *image_path = g_build_filename(save_folder, image_filename, NULL); + gchar *image_path = g_build_filename(save_folder.data(), image_filename, NULL); img->save(image_path, "png"); file_import(doc, image_path, NULL); g_free(image_path); |
