]> git.0d.be Git - empathy.git/blobdiff - src/empathy-new-chatroom-dialog.c
Remove useless mission-control includes
[empathy.git] / src / empathy-new-chatroom-dialog.c
index 5636659323e60440a70a1af04103c56653b81839..b36d0d4f5c2bee5fb6a2194e7b699e3353d1a22c 100644 (file)
 #include <glib/gi18n.h>
 #include <glib/gprintf.h>
 
-#include <libmissioncontrol/mission-control.h>
-#include <libmissioncontrol/mc-account.h>
-#include <libmissioncontrol/mc-profile.h>
-
 #include <libempathy/empathy-tp-roomlist.h>
 #include <libempathy/empathy-chatroom.h>
 #include <libempathy/empathy-utils.h>
@@ -358,15 +354,13 @@ static void
 new_chatroom_dialog_update_widgets (EmpathyNewChatroomDialog *dialog)
 {
        EmpathyAccountChooser *account_chooser;
-       McAccount             *account;
-       McProfile             *profile;
+       EmpathyAccount        *account;
        const gchar           *protocol;
        const gchar           *room;
-       
+
        account_chooser = EMPATHY_ACCOUNT_CHOOSER (dialog->account_chooser);
        account = empathy_account_chooser_dup_account (account_chooser);
-       profile = mc_account_get_profile (account);
-       protocol = mc_profile_get_protocol_name (profile);
+       protocol = empathy_account_get_protocol (account);
 
        gtk_entry_set_text (GTK_ENTRY (dialog->entry_server), "");
 
@@ -391,7 +385,6 @@ new_chatroom_dialog_update_widgets (EmpathyNewChatroomDialog *dialog)
        gtk_widget_grab_focus (dialog->entry_room);
 
        g_object_unref (account);
-       g_object_unref (profile);
 }
 
 static void
@@ -399,12 +392,13 @@ new_chatroom_dialog_account_changed_cb (GtkComboBox             *combobox,
                                        EmpathyNewChatroomDialog *dialog)
 {
        EmpathyAccountChooser *account_chooser;
-       McAccount             *account;
+       EmpathyAccount        *account;
        gboolean               listing = FALSE;
        gboolean               expanded = FALSE;
 
        if (dialog->room_list) {
                g_object_unref (dialog->room_list);
+               dialog->room_list = NULL;
        }
 
        ephy_spinner_stop (EPHY_SPINNER (dialog->throbber));
@@ -412,6 +406,9 @@ new_chatroom_dialog_account_changed_cb (GtkComboBox             *combobox,
 
        account_chooser = EMPATHY_ACCOUNT_CHOOSER (dialog->account_chooser);
        account = empathy_account_chooser_dup_account (account_chooser);
+       if (account == NULL)
+               goto out;
+
        dialog->room_list = empathy_tp_roomlist_new (account);
 
        if (dialog->room_list) {
@@ -444,9 +441,10 @@ new_chatroom_dialog_account_changed_cb (GtkComboBox             *combobox,
                }
        }
 
-       new_chatroom_dialog_update_widgets (dialog);
-
        g_object_unref (account);
+
+out:
+       new_chatroom_dialog_update_widgets (dialog);
 }
 
 static void
@@ -545,7 +543,7 @@ new_chatroom_dialog_listing_cb (EmpathyTpRoomlist        *room_list,
 
        /* Update the throbber */
        if (listing) {
-               ephy_spinner_start (EPHY_SPINNER (dialog->throbber));           
+               ephy_spinner_start (EPHY_SPINNER (dialog->throbber));
        } else {
                ephy_spinner_stop (EPHY_SPINNER (dialog->throbber));
        }
@@ -572,7 +570,7 @@ new_chatroom_dialog_model_row_activated_cb (GtkTreeView             *tree_view,
 static void
 new_chatroom_dialog_model_selection_changed (GtkTreeSelection         *selection,
                                             EmpathyNewChatroomDialog *dialog)
-{      
+{
        GtkTreeModel *model;
        GtkTreeIter   iter;
        gchar        *room = NULL;