diff options
| author | Jon A. Cruz <jon@joncruz.org> | 2009-03-18 08:57:19 +0000 |
|---|---|---|
| committer | joncruz <joncruz@users.sourceforge.net> | 2009-03-18 08:57:19 +0000 |
| commit | 3e198212632008f23a7e1ce6895dd5e48c3dd505 (patch) | |
| tree | 93a713165f85b71e50dfd3d68d990379b44fb364 /src | |
| parent | resolve Bug #339349, drop shadow effect broken (diff) | |
| download | inkscape-3e198212632008f23a7e1ce6895dd5e48c3dd505.tar.gz inkscape-3e198212632008f23a7e1ce6895dd5e48c3dd505.zip | |
Purged use of INKSCAPE_PIXMAPDIR
(bzr r7515)
Diffstat (limited to 'src')
| -rw-r--r-- | src/ui/dialog/swatches.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/ui/dialog/swatches.cpp b/src/ui/dialog/swatches.cpp index c3b5dd678..89bdd4c3c 100644 --- a/src/ui/dialog/swatches.cpp +++ b/src/ui/dialog/swatches.cpp @@ -30,6 +30,7 @@ #include "inkscape.h" #include "inkscape.h" #include "io/sys.h" +#include "io/resource.h" #include "message-context.h" #include "path-prefix.h" #include "preferences.h" @@ -140,19 +141,21 @@ static void dragBegin( GtkWidget */*widget*/, GdkDragContext* dc, gpointer data ColorItem* item = reinterpret_cast<ColorItem*>(data); if ( item ) { + using Inkscape::IO::Resource::get_path; + using Inkscape::IO::Resource::ICONS; + using Inkscape::IO::Resource::SYSTEM; + if (item->def.getType() != eek::ColorDef::RGB){ GError *error = NULL; - gchar *filepath = (gchar *) g_strdup_printf("%s/remove-color.png", INKSCAPE_PIXMAPDIR); gsize bytesRead = 0; gsize bytesWritten = 0; - gchar *localFilename = g_filename_from_utf8( filepath, + gchar *localFilename = g_filename_from_utf8( get_path(SYSTEM, ICONS, "remove-color.png"), -1, &bytesRead, &bytesWritten, &error); GdkPixbuf* pixbuf = gdk_pixbuf_new_from_file_at_scale(localFilename, 32, 24, FALSE, &error); g_free(localFilename); - g_free(filepath); gtk_drag_set_icon_pixbuf( dc, pixbuf, 0, 0 ); return; } @@ -442,11 +445,13 @@ Gtk::Widget* ColorItem::getPreview(PreviewStyle style, ViewType view, ::PreviewS eek_preview_set_color( preview, (def.getR() << 8) | def.getR(), (def.getG() << 8) | def.getG(), (def.getB() << 8) | def.getB()); if ( def.getType() != eek::ColorDef::RGB ) { + using Inkscape::IO::Resource::get_path; + using Inkscape::IO::Resource::ICONS; + using Inkscape::IO::Resource::SYSTEM; GError *error = NULL; - gchar *filepath = (gchar *) g_strdup_printf("%s/remove-color.png", INKSCAPE_PIXMAPDIR); gsize bytesRead = 0; gsize bytesWritten = 0; - gchar *localFilename = g_filename_from_utf8( filepath, + gchar *localFilename = g_filename_from_utf8( get_path(SYSTEM, ICONS, "remove-color.png"), -1, &bytesRead, &bytesWritten, @@ -456,7 +461,6 @@ Gtk::Widget* ColorItem::getPreview(PreviewStyle style, ViewType view, ::PreviewS g_warning("Null pixbuf for %p [%s]", localFilename, localFilename ); } g_free(localFilename); - g_free(filepath); eek_preview_set_pixbuf( preview, pixbuf ); } |
