[eog-plugins] map: Fall back to old marker icon if the new one isn't available



commit 17d778379052ea80e833886cdbef8a17321329c9
Author: Felix Riemann <friemann gnome org>
Date:   Sat Oct 1 15:15:49 2016 +0200

    map: Fall back to old marker icon if the new one isn't available
    
    mark-location doesn't appear to be a "standard" icon yet,
    so try falling back to image-x-generic as before if it is not available.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=771945

 plugins/map/eog-map-plugin.c |   24 +++++++++++++++++++-----
 1 files changed, 19 insertions(+), 5 deletions(-)
---
diff --git a/plugins/map/eog-map-plugin.c b/plugins/map/eog-map-plugin.c
index c8cbd8f..fa5856b 100644
--- a/plugins/map/eog-map-plugin.c
+++ b/plugins/map/eog-map-plugin.c
@@ -58,17 +58,31 @@ eog_map_plugin_finalize (GObject *object)
 
 static void
 update_marker_image (ChamplainLabel *marker,
-                    GtkIconSize size)
+                     GtkIconSize size)
 {
        GtkWidget *widget;
        ClutterActor *thumb;
 
        widget = gtk_button_new ();
        thumb = gtk_clutter_texture_new ();
-       gtk_clutter_texture_set_from_icon_name (GTK_CLUTTER_TEXTURE (thumb),
-                                               widget,
-                                               "mark-location",
-                                               size, NULL);
+       if (G_UNLIKELY (!gtk_clutter_texture_set_from_icon_name (GTK_CLUTTER_TEXTURE (thumb),
+                                                                widget,
+                                                                "mark-location",
+                                                                size, NULL)))
+       {
+               /* mark-location doesn't appear to be a "standard" icon yet,
+                * so try falling back to image-x-generic as before if
+                * it is not available */
+               if (G_UNLIKELY (!gtk_clutter_texture_set_from_icon_name (GTK_CLUTTER_TEXTURE (thumb),
+                                                                        widget,
+                                                                        "image-x-generic",
+                                                                        size, NULL)))
+               {
+                       g_warning ("Could not load icon for map marker. "
+                                  "Please install a suitable icon theme!");
+               }
+       }
+
        /* don't need to unref widget because it is floating */
 
        champlain_label_set_image (marker, thumb);


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