From 4130954c15ab31d5019a262dcd637087fcf4ce59 Mon Sep 17 00:00:00 2001 From: Berke Viktor Date: Fri, 17 May 2013 02:24:47 +0200 Subject: Fix removing keys from favorites --- src/fe-gtk/servlistgui.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/fe-gtk/servlistgui.c b/src/fe-gtk/servlistgui.c index 97c0062f..07a55d69 100644 --- a/src/fe-gtk/servlistgui.c +++ b/src/fe-gtk/servlistgui.c @@ -1384,7 +1384,16 @@ servlist_editkey_cb (GtkCellRendererText *cell, gchar *name, gchar *newval, gpoi if (favchan) { key = favchan->key; - favchan->key = g_strdup (newval); + + if (strlen (newval)) /* check key length, the field can be empty in order to delete the key! */ + { + favchan->key = g_strdup (newval); + } + else /* if key's empty, make sure we actually remove the key */ + { + favchan->key = NULL; + } + gtk_list_store_set (GTK_LIST_STORE (model), &iter, 1, favchan->key, -1); g_free (key); } -- cgit 1.4.1