[anjuta] project-manager: Avoid a critical warning for missing files



commit eea0275403054bd5f8cb76011d97be087be1b02b
Author: SÃbastien Granjoux <seb sfo free fr>
Date:   Wed Nov 14 22:33:16 2012 +0100

    project-manager: Avoid a critical warning for missing files

 plugins/project-manager/project-view.c |   26 +++++++++++++++-----------
 1 files changed, 15 insertions(+), 11 deletions(-)
---
diff --git a/plugins/project-manager/project-view.c b/plugins/project-manager/project-view.c
index ab54a0c..876d127 100644
--- a/plugins/project-manager/project-view.c
+++ b/plugins/project-manager/project-view.c
@@ -398,15 +398,7 @@ get_icon (GFile *file)
 				       NULL,
 				       &error);
 
-	if (file_info == NULL)
-	{
-		pixbuf = gtk_icon_theme_load_icon (gtk_icon_theme_get_default(),
-						   GTK_STOCK_MISSING_IMAGE,
-						   ICON_SIZE,
-						   GTK_ICON_LOOKUP_GENERIC_FALLBACK,
-						   NULL);
-	}
-	else
+	if (file_info != NULL)
 	{
 		icon = g_file_info_get_icon(file_info);
 		g_object_get (icon, "names", &icon_names, NULL);
@@ -414,11 +406,23 @@ get_icon (GFile *file)
 							icon_names,
 							ICON_SIZE,
 							GTK_ICON_LOOKUP_GENERIC_FALLBACK);
-		pixbuf = gtk_icon_info_load_icon (icon_info, NULL);
-		gtk_icon_info_free(icon_info);
+		if (icon_info != NULL)
+		{
+			pixbuf = gtk_icon_info_load_icon (icon_info, NULL);
+			gtk_icon_info_free(icon_info);
+		}
 		g_object_unref (file_info);
 	}
 
+	if (pixbuf == NULL)
+	{
+		pixbuf = gtk_icon_theme_load_icon (gtk_icon_theme_get_default(),
+						   GTK_STOCK_MISSING_IMAGE,
+						   ICON_SIZE,
+						   GTK_ICON_LOOKUP_GENERIC_FALLBACK,
+						   NULL);
+	}
+
 	return pixbuf;
 }
 



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