Fix removing keys from favorites

This commit is contained in:
Berke Viktor 2013-05-17 02:24:47 +02:00
parent 0a2af0ab62
commit 4130954c15
1 changed files with 10 additions and 1 deletions

View File

@ -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);
}