[gimp] app: port about_dialog_load_logo() to GIO



commit 969e2b60f12363e2921d1c28fe39aa8f8705d7a4
Author: Michael Natterer <mitch gimp org>
Date:   Tue Jul 29 12:48:57 2014 +0200

    app: port about_dialog_load_logo() to GIO

 app/dialogs/about-dialog.c |   23 +++++++++++++++--------
 1 files changed, 15 insertions(+), 8 deletions(-)
---
diff --git a/app/dialogs/about-dialog.c b/app/dialogs/about-dialog.c
index 85cde97..70dd15d 100644
--- a/app/dialogs/about-dialog.c
+++ b/app/dialogs/about-dialog.c
@@ -203,19 +203,26 @@ about_dialog_unmap (GtkWidget       *widget,
 static GdkPixbuf *
 about_dialog_load_logo (void)
 {
-  GdkPixbuf *pixbuf;
-  gchar     *filename;
+  GdkPixbuf    *pixbuf = NULL;
+  GFile        *file;
+  GInputStream *input;
 
-  filename = g_build_filename (gimp_data_directory (), "images",
+  file = gimp_data_directory_file ("images",
 #ifdef GIMP_UNSTABLE
-                               "gimp-devel-logo.png",
+                                   "gimp-devel-logo.png",
 #else
-                               "gimp-logo.png",
+                                   "gimp-logo.png",
 #endif
-                               NULL);
+                                   NULL);
 
-  pixbuf = gdk_pixbuf_new_from_file (filename, NULL);
-  g_free (filename);
+  input = G_INPUT_STREAM (g_file_read (file, NULL, NULL));
+  g_object_unref (file);
+
+  if (input)
+    {
+      pixbuf = gdk_pixbuf_new_from_stream (input, NULL, NULL);
+      g_object_unref (input);
+    }
 
   return pixbuf;
 }


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