aboutsummaryrefslogtreecommitdiffstats
path: root/src/empathy-accounts-dialog.c
diff options
context:
space:
mode:
authorRob Bradford <rob@linux.intel.com>2010-06-02 19:47:34 +0800
committerRob Bradford <rob@linux.intel.com>2010-06-03 21:46:51 +0800
commit77e7d105ecc88a77bd7838d36512b4dd3d4d8877 (patch)
treef400e973ff23128c05e26e5071cf5163f7be9a57 /src/empathy-accounts-dialog.c
parent4b91df6fd314c16844ec39f854197dc6ecb2f11c (diff)
downloadgsoc2013-empathy-77e7d105ecc88a77bd7838d36512b4dd3d4d8877.tar
gsoc2013-empathy-77e7d105ecc88a77bd7838d36512b4dd3d4d8877.tar.gz
gsoc2013-empathy-77e7d105ecc88a77bd7838d36512b4dd3d4d8877.tar.bz2
gsoc2013-empathy-77e7d105ecc88a77bd7838d36512b4dd3d4d8877.tar.lz
gsoc2013-empathy-77e7d105ecc88a77bd7838d36512b4dd3d4d8877.tar.xz
gsoc2013-empathy-77e7d105ecc88a77bd7838d36512b4dd3d4d8877.tar.zst
gsoc2013-empathy-77e7d105ecc88a77bd7838d36512b4dd3d4d8877.zip
accounts-dialog: Ensure correct connectivity information
Move the creation of the EmpathyConnectivity object to the dialog construction so that there is time for the asynchronous calls that the EmpathyConnectivity makes (in ConnMan mode) to return. Without this change the error is always reported as network connection failure rather than the real error when built with ConnMan. Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=620474
Diffstat (limited to 'src/empathy-accounts-dialog.c')
-rw-r--r--src/empathy-accounts-dialog.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/empathy-accounts-dialog.c b/src/empathy-accounts-dialog.c
index 90fc37f8d..a02777885 100644
--- a/src/empathy-accounts-dialog.c
+++ b/src/empathy-accounts-dialog.c
@@ -113,6 +113,7 @@ typedef struct {
TpAccountManager *account_manager;
EmpathyConnectionManagers *cms;
+ EmpathyConnectivity *connectivity;
GtkWindow *parent_window;
TpAccount *initial_selection;
@@ -201,7 +202,6 @@ accounts_dialog_update_status_infobar (EmpathyAccountsDialog *dialog,
guint status;
guint reason;
guint presence;
- EmpathyConnectivity *connectivity;
GtkTreeView *view;
GtkTreeModel *model;
GtkTreeSelection *selection;
@@ -303,11 +303,9 @@ accounts_dialog_update_status_infobar (EmpathyAccountsDialog *dialog,
GTK_MESSAGE_ERROR);
}
- connectivity = empathy_connectivity_dup_singleton ();
- if (!empathy_connectivity_is_online (connectivity))
+ if (!empathy_connectivity_is_online (priv->connectivity))
message = _("Offline — No Network Connection");
- g_object_unref (connectivity);
ephy_spinner_stop (EPHY_SPINNER (priv->throbber));
gtk_widget_show (priv->image_status);
gtk_widget_hide (priv->throbber);
@@ -2140,6 +2138,12 @@ do_dispose (GObject *obj)
priv->cms = NULL;
}
+ if (priv->connectivity)
+ {
+ g_object_unref (priv->connectivity);
+ priv->connectivity = NULL;
+ }
+
if (priv->initial_selection != NULL)
g_object_unref (priv->initial_selection);
priv->initial_selection = NULL;
@@ -2224,6 +2228,8 @@ do_constructed (GObject *object)
gtk_widget_show (import_dialog);
}
}
+
+ priv->connectivity = empathy_connectivity_dup_singleton ();
}
static void