typedef struct {
EmpathyTpRoomlist *room_list;
+ /* Currently selected account */
+ TpAccount *account;
GtkWidget *window;
GtkWidget *vbox_widgets;
}
g_object_unref (dialog->model);
+ if (dialog->account != NULL) {
+ g_object_unref (dialog->account);
+ }
+
g_free (dialog);
}
new_chatroom_dialog_update_widgets (EmpathyNewChatroomDialog *dialog)
{
EmpathyAccountChooser *account_chooser;
- TpAccount *account;
const gchar *protocol;
const gchar *room;
account_chooser = EMPATHY_ACCOUNT_CHOOSER (dialog->account_chooser);
- account = empathy_account_chooser_dup_account (account_chooser);
- if (account == NULL)
+ if (dialog->account == NULL)
return;
- protocol = tp_account_get_protocol (account);
+ protocol = tp_account_get_protocol (dialog->account);
gtk_entry_set_text (GTK_ENTRY (dialog->entry_server), "");
/* Final set up of the dialog */
gtk_widget_grab_focus (dialog->entry_room);
-
- g_object_unref (account);
}
static void
EmpathyNewChatroomDialog *dialog)
{
EmpathyAccountChooser *account_chooser;
- TpAccount *account;
gboolean listing = FALSE;
gboolean expanded = FALSE;
ephy_spinner_stop (EPHY_SPINNER (dialog->throbber));
new_chatroom_dialog_model_clear (dialog);
+ if (dialog->account != NULL) {
+ g_object_unref (dialog->account);
+ }
+
account_chooser = EMPATHY_ACCOUNT_CHOOSER (dialog->account_chooser);
- account = empathy_account_chooser_dup_account (account_chooser);
- if (account == NULL)
+ dialog->account = empathy_account_chooser_dup_account (account_chooser);
+ if (dialog->account == NULL)
goto out;
- dialog->room_list = empathy_tp_roomlist_new (account);
+ dialog->room_list = empathy_tp_roomlist_new (dialog->account);
if (dialog->room_list) {
g_signal_connect (dialog->room_list, "destroy",
}
}
- g_object_unref (account);
-
out:
new_chatroom_dialog_update_widgets (dialog);
}