[gnome-control-center] background: Ignore screenshots



commit a3055b3202ca4446f15fa7941c25811a7b4e2f7c
Author: Bastien Nocera <hadess hadess net>
Date:   Thu Apr 26 11:07:08 2012 +0100

    background: Ignore screenshots
    
    Don't list screenshots coming from gnome-screenshot in our
    Pictures source.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=672925

 panels/background/bg-pictures-source.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/panels/background/bg-pictures-source.c b/panels/background/bg-pictures-source.c
index 228803a..80ffce7 100644
--- a/panels/background/bg-pictures-source.c
+++ b/panels/background/bg-pictures-source.c
@@ -138,6 +138,7 @@ picture_scaled (GObject *source_object,
   GError *error = NULL;
   GdkPixbuf *pixbuf;
   const char *source_url;
+  const char *software;
 
   GtkTreeIter iter;
   GtkListStore *store;
@@ -154,6 +155,18 @@ picture_scaled (GObject *source_object,
       return;
     }
 
+  /* Ignore screenshots */
+  software = gdk_pixbuf_get_option (pixbuf, "tEXt::Software");
+  if (software != NULL &&
+      g_str_equal (software, "gnome-screenshot"))
+    {
+      g_debug ("Ignored URL '%s' as it's a screenshot from gnome-screenshot",
+               cc_background_item_get_uri (item));
+      g_object_unref (pixbuf);
+      g_object_unref (item);
+      return;
+    }
+
   /* insert the item into the liststore */
   gtk_list_store_insert_with_values (store, &iter, 0,
                                      0, pixbuf,



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