priv->filter = NULL;
priv->filter_data = NULL;
- priv->manager = empathy_account_manager_new ();
+ priv->manager = empathy_account_manager_dup_singleton ();
g_signal_connect (priv->manager, "account-created",
G_CALLBACK (account_chooser_account_created_cb),
priv->contacts_width = -1;
priv->sent_messages = NULL;
priv->sent_messages_index = -1;
- priv->account_manager = empathy_account_manager_new ();
+ priv->account_manager = empathy_account_manager_dup_singleton ();
g_signal_connect (priv->account_manager,
"account-connection-changed",
actual_c = mission_control_get_connection_status (mc, account, &err);
if (err != NULL)
- actual_c = TP_CONNECTION_STATUS_DISCONNECTED;
+ {
+ actual_c = TP_CONNECTION_STATUS_DISCONNECTED;
+ g_error_free (err);
+ }
return account_data_new (actual_p, actual_c, mc_account_is_enabled (account));
}
/* public methods */
EmpathyAccountManager *
-empathy_account_manager_new (void)
+empathy_account_manager_dup_singleton (void)
{
return g_object_new (EMPATHY_TYPE_ACCOUNT_MANAGER, NULL);
}
/* public methods */
-EmpathyAccountManager * empathy_account_manager_new (void);
+EmpathyAccountManager * empathy_account_manager_dup_singleton (void);
int empathy_account_manager_get_connected_accounts
(EmpathyAccountManager *manager);
int empathy_account_manager_get_connecting_accounts
empathy_account_equal,
(GDestroyNotify) g_object_unref,
(GDestroyNotify) g_object_unref);
- priv->account_manager = empathy_account_manager_new ();
+ priv->account_manager = empathy_account_manager_dup_singleton ();
priv->contact_monitor = empathy_contact_monitor_new_for_proxy (EMPATHY_CONTACT_LIST (manager));
g_signal_connect (priv->account_manager,
dispatcher->priv = priv;
priv->mc = empathy_mission_control_new ();
- priv->account_manager = empathy_account_manager_new ();
+ priv->account_manager = empathy_account_manager_dup_singleton ();
g_signal_connect (priv->account_manager,
"account-connection-changed",
EMPATHY_TYPE_TP_CONTACT_FACTORY, EmpathyTpContactFactoryPriv);
tp_factory->priv = priv;
- priv->account_manager = empathy_account_manager_new ();
+ priv->account_manager = empathy_account_manager_dup_singleton ();
g_signal_connect (priv->account_manager, "account-connection-changed",
G_CALLBACK (tp_contact_factory_account_connection_cb),
dialog);
/* Set up signalling */
- dialog->account_manager = empathy_account_manager_new ();
+ dialog->account_manager = empathy_account_manager_dup_singleton ();
dialog->mc = empathy_mission_control_new ();
g_signal_connect (dialog->account_manager, "account-created",
McPresence previous,
EmpathyMainWindow *window)
{
- EmpathyAccountManager *acc_manager;
McAccount *account;
gboolean should_play;
- acc_manager = empathy_account_manager_new ();
account = empathy_contact_get_account (contact);
- should_play = !empathy_account_manager_is_account_just_connected (acc_manager, account);
+ should_play = !empathy_account_manager_is_account_just_connected (window->account_manager, account);
if (!should_play) {
- goto out;
+ return;
}
if (previous < MC_PRESENCE_AVAILABLE && current > MC_PRESENCE_OFFLINE) {
CA_PROP_EVENT_DESCRIPTION, _("Contact logged in"),
NULL);
}
- goto out;
+ return;
}
if (previous > MC_PRESENCE_OFFLINE && current < MC_PRESENCE_AVAILABLE) {
NULL);
}
}
-out:
- g_object_unref (acc_manager);
}
GtkWidget *
g_object_unref (glade);
window->mc = empathy_mission_control_new ();
- window->account_manager = empathy_account_manager_new ();
+ window->account_manager = empathy_account_manager_dup_singleton ();
g_signal_connect (window->account_manager,
"account-connection-changed",
icon->priv = priv;
priv->icon = gtk_status_icon_new ();
- priv->account_manager = empathy_account_manager_new ();
+ priv->account_manager = empathy_account_manager_dup_singleton ();
priv->idle = empathy_idle_new ();
priv->event_manager = empathy_event_manager_new ();