diff options
author | Carlos Garcia Campos <cgarcia@igalia.com> | 2014-08-14 10:11:44 +0200 |
---|---|---|
committer | Carlos Garcia Campos <carlosgc@gnome.org> | 2014-08-14 10:15:44 +0200 |
commit | 3b0d8ac653cba919756e3d614c6fa7699720038b (patch) | |
tree | 922433b9d661699cd48b31bb3c92f4ecbce57faa | |
parent | a1350e9286ec77e0397ee341aa20b268254efefc (diff) | |
download | epiphany-3b0d8ac653cba919756e3d614c6fa7699720038b.tar.gz |
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().
-rw-r--r-- | 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 a80c1df2b..412f782d2 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); } /** |