[maemo-commits] [maemo-commits] r12969 - in projects/haf/trunk/gtk+: . gtk

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Tue Jul 31 18:42:18 EEST 2007
Author: marivoll
Date: 2007-07-31 18:42:15 +0300 (Tue, 31 Jul 2007)
New Revision: 12969

Modified:
   projects/haf/trunk/gtk+/ChangeLog
   projects/haf/trunk/gtk+/gtk/gtkfilesystem.c
   projects/haf/trunk/gtk+/gtk/gtkfilesystem.h
Log:
 	* gtk/gtkfilesystem.h, gtk/gtkfilesystem.c [MAEMO_CHANGES]
 	(_GtkFileInfo): Added icon_pixbuf field.
 	(gtk_file_info_copy, gtk_file_info_free): Maintain it.
 	(gtk_file_info_set_icon_pixbuf): New.
 	(gtk_file_info_render_icon): Use icon_pixbuf when we have one.


Modified: projects/haf/trunk/gtk+/ChangeLog
===================================================================
--- projects/haf/trunk/gtk+/ChangeLog	2007-07-31 15:32:55 UTC (rev 12968)
+++ projects/haf/trunk/gtk+/ChangeLog	2007-07-31 15:42:15 UTC (rev 12969)
@@ -1,3 +1,12 @@
+2007-07-31  Marius Vollmer  <marius.vollmer at nokia.com>
+
+ 	* gtk/gtkfilesystem.h, gtk/gtkfilesystem.c [MAEMO_CHANGES]
+ 	(_GtkFileInfo): Added icon_pixbuf field.
+ 	(gtk_file_info_copy, gtk_file_info_free): Maintain it.
+ 	(gtk_file_info_set_icon_pixbuf): New.
+ 	(gtk_file_info_render_icon): Use icon_pixbuf when we have one.
+	Fixes: NB#N64277
+	
 2007-07-31  Michael Natterer  <mitch at imendio.com>
 
 	Merge from trunk:

Modified: projects/haf/trunk/gtk+/gtk/gtkfilesystem.c
===================================================================
--- projects/haf/trunk/gtk+/gtk/gtkfilesystem.c	2007-07-31 15:32:55 UTC (rev 12968)
+++ projects/haf/trunk/gtk+/gtk/gtkfilesystem.c	2007-07-31 15:42:15 UTC (rev 12969)
@@ -39,6 +39,9 @@
   gchar *icon_name;
   guint is_folder : 1;
   guint is_hidden : 1;
+#ifdef MAEMO_CHANGES
+  GdkPixbuf *icon_pixbuf;
+#endif
 };
 
 static void gtk_file_system_base_init (gpointer g_class);
@@ -94,6 +97,10 @@
     new_info->icon_name = g_strdup (new_info->icon_name);
   if (new_info->display_key)
     new_info->display_key = g_strdup (new_info->display_key);
+#ifdef MAEMO_CHANGES
+  if (new_info->icon_pixbuf)
+    g_object_ref (new_info->icon_pixbuf);
+#endif
 
   return new_info;
 }
@@ -111,6 +118,10 @@
     g_free (info->display_key);
   if (info->icon_name)
     g_free (info->icon_name);
+#ifdef MAEMO_CHANGES
+  if (info->icon_pixbuf)
+    g_object_unref (info->icon_pixbuf);
+#endif
 
   g_free (info);
 }
@@ -278,6 +289,20 @@
   return info->icon_name;
 }
 
+#ifdef MAEMO_CHANGES
+void
+gtk_file_info_set_icon_pixbuf (GtkFileInfo *info,
+			       GdkPixbuf *icon_pixbuf)
+{
+  g_return_if_fail (info != NULL);
+  
+  g_object_ref (icon_pixbuf);
+  if (info->icon_pixbuf)
+    g_object_unref (info->icon_pixbuf);
+  info->icon_pixbuf = icon_pixbuf;
+}
+#endif
+
 GdkPixbuf *
 gtk_file_info_render_icon (const GtkFileInfo  *info,
 			   GtkWidget          *widget,
@@ -289,8 +314,16 @@
   g_return_val_if_fail (info != NULL, NULL);
   g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL);
 
-  if (info->icon_name)
+#ifdef MAEMO_CHANGES
+  if (info->icon_pixbuf)
     {
+      pixbuf = info->icon_pixbuf;
+      gdk_pixbuf_ref (pixbuf);
+    }
+#endif
+
+  if (info->icon_name && !pixbuf)
+    {
       if (g_path_is_absolute (info->icon_name))
 	pixbuf = gdk_pixbuf_new_from_file_at_size (info->icon_name,
 						   pixel_size,

Modified: projects/haf/trunk/gtk+/gtk/gtkfilesystem.h
===================================================================
--- projects/haf/trunk/gtk+/gtk/gtkfilesystem.h	2007-07-31 15:32:55 UTC (rev 12968)
+++ projects/haf/trunk/gtk+/gtk/gtkfilesystem.h	2007-07-31 15:42:15 UTC (rev 12969)
@@ -118,6 +118,11 @@
 							   gint               pixel_size,
 							   GError           **error);
 
+#ifdef MAEMO_CHANGES
+void                  gtk_file_info_set_icon_pixbuf       (GtkFileInfo *info,
+							   GdkPixbuf   *icon_pixbuf);
+#endif /* MAEMO_CHANGES */
+
 /* GtkFileSystemHandle
  */
 


More information about the maemo-commits mailing list