1
0
mirror of https://github.com/moparisthebest/hexchat synced 2024-11-26 03:02:17 -05:00

Fix removing keys from favorites

This commit is contained in:
Berke Viktor 2013-05-17 02:24:47 +02:00
parent 0a2af0ab62
commit 4130954c15

View File

@ -1384,7 +1384,16 @@ servlist_editkey_cb (GtkCellRendererText *cell, gchar *name, gchar *newval, gpoi
if (favchan) if (favchan)
{ {
key = favchan->key; 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); gtk_list_store_set (GTK_LIST_STORE (model), &iter, 1, favchan->key, -1);
g_free (key); g_free (key);
} }