gpointing-device-settings r289 - trunk/modules



Author: hiikezoe
Date: Sun Mar 29 09:44:13 2009
New Revision: 289
URL: http://svn.gnome.org/viewvc/gpointing-device-settings?rev=289&view=rev

Log:
Use gpds_get_icon_file_directory().

Modified:
   trunk/modules/gpds-mouse-ui.c
   trunk/modules/gpds-touchpad-ui.c

Modified: trunk/modules/gpds-mouse-ui.c
==============================================================================
--- trunk/modules/gpds-mouse-ui.c	(original)
+++ trunk/modules/gpds-mouse-ui.c	Sun Mar 29 09:44:13 2009
@@ -497,9 +497,21 @@
 static GdkPixbuf *
 get_icon_pixbuf (GpdsUI *ui, GError **error)
 {
+    const gchar *pixbuf_name;
+    gchar *path;
+    GdkPixbuf *pixbuf;
+
     if (strstr(gpds_ui_get_device_name(ui), "TrackPoint"))
-        return gdk_pixbuf_new_from_file(GPDS_ICONDIR "/trackpoint.png", error);
-    return gdk_pixbuf_new_from_file(GPDS_ICONDIR "/mouse.png", error);
+        pixbuf_name = "trackpoint.png";
+    else 
+        pixbuf_name = "mouse.png";
+
+    path = g_build_filename(gpds_get_icon_file_directory(),
+                            pixbuf_name, NULL);
+    pixbuf = gdk_pixbuf_new_from_file(path, error);
+    g_free(path);
+
+    return pixbuf;
 }
 
 /*

Modified: trunk/modules/gpds-touchpad-ui.c
==============================================================================
--- trunk/modules/gpds-touchpad-ui.c	(original)
+++ trunk/modules/gpds-touchpad-ui.c	Sun Mar 29 09:44:13 2009
@@ -827,8 +827,15 @@
 static GdkPixbuf *
 get_icon_pixbuf (GpdsUI *ui, GError **error)
 {
-    return gdk_pixbuf_new_from_file(GPDS_ICONDIR "/touchpad.png",
-                                    error);
+    gchar *path;
+    GdkPixbuf *pixbuf;
+
+    path = g_build_filename(gpds_get_icon_file_directory(),
+                            "touchpad", NULL);
+    pixbuf = gdk_pixbuf_new_from_file(path, error);
+    g_free(path);
+
+    return pixbuf;
 }
 
 /*



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]