summary refs log tree commit diff stats
path: root/src/fe-gtk/servlistgui.c
diff options
context:
space:
mode:
authorBerke Viktor <bviktor@hexchat.org>2013-05-17 02:24:47 +0200
committerBerke Viktor <bviktor@hexchat.org>2013-05-17 02:24:47 +0200
commit4130954c15ab31d5019a262dcd637087fcf4ce59 (patch)
tree955abe6e7177886758e43aaa582bf0689fd9263a /src/fe-gtk/servlistgui.c
parent0a2af0ab6256f5ccbbd81e62fabfc8fa6022995b (diff)
Fix removing keys from favorites
Diffstat (limited to 'src/fe-gtk/servlistgui.c')
-rw-r--r--src/fe-gtk/servlistgui.c11
1 files changed, 10 insertions, 1 deletions
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);
 	}