[386/906] pixbufdrop: fix example on win32
authorJulien Isorce <julien.isorce@gmail.com>
Thu, 22 Oct 2009 23:07:29 +0000 (01:07 +0200)
committerMatthew Waters <ystreet00@gmail.com>
Sat, 15 Mar 2014 17:36:37 +0000 (18:36 +0100)
tests/examples/gtk/fxtest/pixbufdrop.c

index 6fd1783..cd7f175 100644 (file)
@@ -126,8 +126,11 @@ on_drag_data_received (GtkWidget * widget,
     GdkDragContext * context, int x, int y,
     GtkSelectionData * seldata, guint inf, guint time, gpointer data)
 {
-  GdkPixbufFormat *format;
   SourceData *userdata = g_new0 (SourceData, 1);
+#ifdef G_OS_WIN32
+  gchar *filename = g_filename_from_uri (seldata->data, NULL, NULL);
+#else
+  GdkPixbufFormat *format;
   gchar **uris = gtk_selection_data_get_uris (seldata);
   gchar *filename = NULL;
 
@@ -138,6 +141,8 @@ on_drag_data_received (GtkWidget * widget,
   g_return_if_fail (format);
   g_print ("received %s image: %s\n", filename,
       gdk_pixbuf_format_get_name (format));
+#endif
+
   userdata->nick = "location";
   userdata->value = g_strdup (filename);
   userdata->data = data;