[epiphany] location-entry: Reset the lock icon when security level is EPHY_SECURITY_LEVEL_NO_SECURITY



commit 3b0d8ac653cba919756e3d614c6fa7699720038b
Author: Carlos Garcia Campos <cgarcia igalia com>
Date:   Thu Aug 14 10:11:44 2014 +0200

    location-entry: Reset the lock icon when security level is EPHY_SECURITY_LEVEL_NO_SECURITY
    
    We were returning early leaving the existing icon for non HTTPS pages.
    We don't need to keep the gicon and resetting it every time a new
    security level is set, we can simply use gtk_entry_set_icon_from_icon_name()
    with the name we get from ephy_security_level_to_icon_name().

 lib/widgets/ephy-location-entry.c |   23 +++--------------------
 1 files changed, 3 insertions(+), 20 deletions(-)
---
diff --git a/lib/widgets/ephy-location-entry.c b/lib/widgets/ephy-location-entry.c
index a80c1df..412f782 100644
--- a/lib/widgets/ephy-location-entry.c
+++ b/lib/widgets/ephy-location-entry.c
@@ -51,7 +51,6 @@
 
 struct _EphyLocationEntryPrivate
 {
-       GIcon *lock_gicon;
        GdkPixbuf *favicon;
        GtkTreeModel *model;
        GtkEntryCompletion *completion;
@@ -192,11 +191,6 @@ ephy_location_entry_finalize (GObject *object)
        {
                g_object_unref (priv->favicon);
        }
-       
-       if (priv->lock_gicon)
-       {
-               g_object_unref (priv->lock_gicon);
-       }
 
        G_OBJECT_CLASS (ephy_location_entry_parent_class)->finalize (object);
 }
@@ -1585,25 +1579,14 @@ ephy_location_entry_set_security_level (EphyLocationEntry *entry,
                                        EphySecurityLevel security_level)
 
 {
-       EphyLocationEntryPrivate *priv;
        const char *icon_name;
 
        g_return_if_fail (EPHY_IS_LOCATION_ENTRY (entry));
 
-       priv = entry->priv;
-
-       g_clear_object (&priv->lock_gicon);
-
        icon_name = ephy_security_level_to_icon_name (security_level);
-       if (icon_name == NULL)
-               return;
-
-       g_assert (security_level != EPHY_SECURITY_LEVEL_NO_SECURITY);
-
-       priv->lock_gicon = g_themed_icon_new_with_default_fallbacks (icon_name);
-       gtk_entry_set_icon_from_gicon (GTK_ENTRY (entry),
-                                      GTK_ENTRY_ICON_SECONDARY,
-                                      priv->lock_gicon);
+       gtk_entry_set_icon_from_icon_name (GTK_ENTRY (entry),
+                                          GTK_ENTRY_ICON_SECONDARY,
+                                          icon_name);
 }
 
 /**


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