aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk
diff options
context:
space:
mode:
authorGuillaume Desmottes <gdesmott@gnome.org>2008-02-03 04:18:25 +0800
committerGuillaume Desmottes <gdesmott@gnome.org>2008-02-03 04:18:25 +0800
commit845230d21d421a9114f279ac65b8a66d9f1f8312 (patch)
tree60b1689c106bce8670be1118f28166147430ced5 /libempathy-gtk
parent8ce55a66dad6bba2114b1e218051bc9eba3c778b (diff)
downloadgsoc2013-empathy-845230d21d421a9114f279ac65b8a66d9f1f8312.tar
gsoc2013-empathy-845230d21d421a9114f279ac65b8a66d9f1f8312.tar.gz
gsoc2013-empathy-845230d21d421a9114f279ac65b8a66d9f1f8312.tar.bz2
gsoc2013-empathy-845230d21d421a9114f279ac65b8a66d9f1f8312.tar.lz
gsoc2013-empathy-845230d21d421a9114f279ac65b8a66d9f1f8312.tar.xz
gsoc2013-empathy-845230d21d421a9114f279ac65b8a66d9f1f8312.tar.zst
gsoc2013-empathy-845230d21d421a9114f279ac65b8a66d9f1f8312.zip
IRC widget: properly remove the network
Diffstat (limited to 'libempathy-gtk')
-rw-r--r--libempathy-gtk/empathy-account-widget-irc.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/libempathy-gtk/empathy-account-widget-irc.c b/libempathy-gtk/empathy-account-widget-irc.c
index de5e8b71d..a6be3250b 100644
--- a/libempathy-gtk/empathy-account-widget-irc.c
+++ b/libempathy-gtk/empathy-account-widget-irc.c
@@ -147,8 +147,7 @@ account_widget_irc_button_remove_clicked_cb (GtkWidget *button,
g_object_get (network, "name", &name, NULL);
empathy_debug (DEBUG_DOMAIN, "Remove network %s", name);
- /* TODO: remove the network from the store */
- //gtk_list_store_remove (GTK_LIST_STORE (model), &iter);
+ gtk_list_store_remove (GTK_LIST_STORE (model), &iter);
empathy_irc_network_manager_remove (settings->network_manager, network);
g_free (name);
@@ -209,6 +208,14 @@ account_widget_irc_sort (GtkTreeModel *model,
}
static void
+unset_server_values (EmpathyAccountWidgetIrc *settings)
+{
+ mc_account_unset_param (settings->account, "server");
+ mc_account_unset_param (settings->account, "port");
+ mc_account_unset_param (settings->account, "use-ssl");
+}
+
+static void
account_widget_irc_combobox_network_changed_cb (GtkWidget *combobox,
EmpathyAccountWidgetIrc *settings)
{
@@ -216,7 +223,12 @@ account_widget_irc_combobox_network_changed_cb (GtkWidget *combobox,
GtkTreeModel *model;
EmpathyIrcNetwork *network;
- gtk_combo_box_get_active_iter (GTK_COMBO_BOX (combobox), &iter);
+ if (!gtk_combo_box_get_active_iter (GTK_COMBO_BOX (combobox), &iter))
+ {
+ unset_server_values (settings);
+ return;
+ }
+
model = gtk_combo_box_get_model (GTK_COMBO_BOX (combobox));
gtk_tree_model_get (model, &iter, COL_NETWORK_OBJ, &network, -1);
@@ -254,10 +266,9 @@ account_widget_irc_combobox_network_changed_cb (GtkWidget *combobox,
else
{
/* No server. Unset values */
- mc_account_unset_param (settings->account, "server");
- mc_account_unset_param (settings->account, "port");
- mc_account_unset_param (settings->account, "use-ssl");
+ unset_server_values (settings);
}
+
g_slist_foreach (servers, (GFunc) g_object_unref, NULL);
g_slist_free (servers);
g_object_unref (network);