[Xfce4-commits] <thunar:master> Use GTK_STOCK_FILE as the fallback icon for files (bug #6662).

Jannis Pohlmann noreply at xfce.org
Sun Nov 14 02:38:01 CET 2010


Updating branch refs/heads/master
         to 1546ba7e153afe23443b7ee0ecb0c483166e2642 (commit)
       from f4f3b2003bcc902f68f5408fedbe73f9bd27e915 (commit)

commit 1546ba7e153afe23443b7ee0ecb0c483166e2642
Author: Jannis Pohlmann <jannis at xfce.org>
Date:   Sun Nov 14 02:36:36 2010 +0100

    Use GTK_STOCK_FILE as the fallback icon for files (bug #6662).
    
    As a consequence, we no longer need the fallback icon. It is thus
    removed from the repository.

 NEWS                             |    1 +
 pixmaps/Makefile.am              |    3 +--
 pixmaps/Thunar-fallback-icon.png |  Bin 1531 -> 0 bytes
 thunar/thunar-icon-factory.c     |   28 ++++++++--------------------
 4 files changed, 10 insertions(+), 22 deletions(-)

diff --git a/NEWS b/NEWS
index 0f23e9d..6407753 100644
--- a/NEWS
+++ b/NEWS
@@ -12,6 +12,7 @@
 - Permanently delete files if at least one of them cannot be trashed
   (bug #6748).
 - Fix a typo in configure.in.in (bug #6724).
+- Use GTK_STOCK_FILE as the fallback icon for files (bug #6662).
 
 1.1.4
 =====
diff --git a/pixmaps/Makefile.am b/pixmaps/Makefile.am
index efbab73..ca98f6a 100644
--- a/pixmaps/Makefile.am
+++ b/pixmaps/Makefile.am
@@ -2,8 +2,7 @@
 
 pixmapsdir = $(datadir)/pixmaps/Thunar
 pixmaps_DATA =								\
-	Thunar-about-logo.png						\
-	Thunar-fallback-icon.png
+	Thunar-about-logo.png
 
 EXTRA_DIST =								\
 	$(pixmaps_DATA)
diff --git a/pixmaps/Thunar-fallback-icon.png b/pixmaps/Thunar-fallback-icon.png
deleted file mode 100644
index 1805538..0000000
Binary files a/pixmaps/Thunar-fallback-icon.png and /dev/null differ
diff --git a/thunar/thunar-icon-factory.c b/thunar/thunar-icon-factory.c
index bf7fc9e..576329a 100644
--- a/thunar/thunar-icon-factory.c
+++ b/thunar/thunar-icon-factory.c
@@ -1,7 +1,7 @@
 /* $Id$ */
 /*-
  * Copyright (c) 2005-2006 Benedikt Meurer <benny at xfce.org>
- * Copyright (c) 2009 Jannis Pohlmann <jannis at xfce.org>
+ * Copyright (c) 2009-2010 Jannis Pohlmann <jannis at xfce.org>
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by the Free
@@ -92,7 +92,8 @@ static void       thunar_icon_factory_mark_recently_used    (ThunarIconFactory
 static guint      thunar_icon_key_hash                      (gconstpointer             data);
 static gboolean   thunar_icon_key_equal                     (gconstpointer             a,
                                                              gconstpointer             b);
-static GdkPixbuf *thunar_icon_factory_load_fallback         (gint                      size);
+static GdkPixbuf *thunar_icon_factory_load_fallback         (ThunarIconFactory        *factory,
+                                                             gint                      size);
 
 
 
@@ -541,7 +542,7 @@ thunar_icon_factory_lookup_icon (ThunarIconFactory *factory,
           if (!wants_default)
             return NULL;
           else
-            return thunar_icon_factory_load_fallback (size);
+            return thunar_icon_factory_load_fallback (factory, size);
         }
 
       /* generate a key for the new cached icon */
@@ -635,23 +636,10 @@ thunar_icon_key_equal (gconstpointer a,
 
 
 static GdkPixbuf*
-thunar_icon_factory_load_fallback (gint size)
+thunar_icon_factory_load_fallback (ThunarIconFactory *factory,
+                                   gint               size)
 {
-  static const gchar THUNAR_FALLBACK_ICON_PATH[] = DATADIR "/pixmaps/Thunar/Thunar-fallback-icon.png";
-  GdkPixbuf         *pixbuf;
-  GError            *error = NULL;
-
-  /* try to load the fallback icon */
-  pixbuf = gdk_pixbuf_new_from_file_at_scale (THUNAR_FALLBACK_ICON_PATH, size, size, TRUE, &error);
-
-  /* verify that it was loaded */
-  if (G_UNLIKELY (pixbuf == NULL))
-    {
-      g_error (_("Failed to load fallback icon from \"%s\" (%s). Check your installation!"), THUNAR_FALLBACK_ICON_PATH, error->message);
-      g_error_free (error);
-    }
-
-  return pixbuf;
+  return thunar_icon_factory_lookup_icon (factory, GTK_STOCK_FILE, size, FALSE);
 }
 
 
@@ -787,7 +775,7 @@ thunar_icon_factory_load_icon (ThunarIconFactory        *factory,
     {
       /* check if the caller will happly accept the fallback icon */
       if (G_LIKELY (wants_default))
-        return thunar_icon_factory_load_fallback (size);
+        return thunar_icon_factory_load_fallback (factory, size);
       else
         return NULL;
     }



More information about the Xfce4-commits mailing list