psppire: Relocate icon files also.
authorBen Pfaff <blp@cs.stanford.edu>
Mon, 12 Aug 2013 04:55:42 +0000 (21:55 -0700)
committerBen Pfaff <blp@cs.stanford.edu>
Mon, 12 Aug 2013 04:55:42 +0000 (21:55 -0700)
Otherwise the icons can't be found with --enable-relocatable when the
program is not installed in the normal system location.

src/ui/gui/psppire.c

index a183aa6751a0a16a178a2cd231ca7979fc9b1c89..d22e2895289806be3f77057b788f20dcf67531b5 100644 (file)
@@ -225,10 +225,13 @@ create_icon_factory (void)
                                               ic->context_name,
                                               sizes[r].resolution, sizes[r].resolution,
                                               ic->icon_name[i]);
-           
-           gtk_icon_source_set_filename (source, filename);
+           const char *relocated_filename = relocate (filename);
+
+           gtk_icon_source_set_filename (source, relocated_filename);
            gtk_icon_source_set_size_wildcarded (source, FALSE);
            gtk_icon_source_set_size (source, sizes[r].size);
+           if (filename != relocated_filename)
+             free (CONST_CAST (char *, relocated_filename));
            g_free (filename);
            gtk_icon_set_add_source (icon_set, source);
          }