aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui/component/addressbook.c
diff options
context:
space:
mode:
authorSivaiah Nallagatla <siva@src.gnome.org>2004-12-24 02:04:56 +0800
committerSivaiah Nallagatla <siva@src.gnome.org>2004-12-24 02:04:56 +0800
commit72e4f1181ba63747f0204ef6f019a265c25cb616 (patch)
treed310913888d3d137d690444bc77291827fe75f88 /addressbook/gui/component/addressbook.c
parent67dee2832ef29749a2cf1db70e87c5dc469a6576 (diff)
downloadgsoc2013-evolution-72e4f1181ba63747f0204ef6f019a265c25cb616.tar
gsoc2013-evolution-72e4f1181ba63747f0204ef6f019a265c25cb616.tar.gz
gsoc2013-evolution-72e4f1181ba63747f0204ef6f019a265c25cb616.tar.bz2
gsoc2013-evolution-72e4f1181ba63747f0204ef6f019a265c25cb616.tar.lz
gsoc2013-evolution-72e4f1181ba63747f0204ef6f019a265c25cb616.tar.xz
gsoc2013-evolution-72e4f1181ba63747f0204ef6f019a265c25cb616.tar.zst
gsoc2013-evolution-72e4f1181ba63747f0204ef6f019a265c25cb616.zip
Merge from offline brnach
svn path=/trunk/; revision=28194
Diffstat (limited to 'addressbook/gui/component/addressbook.c')
-rw-r--r--addressbook/gui/component/addressbook.c36
1 files changed, 26 insertions, 10 deletions
diff --git a/addressbook/gui/component/addressbook.c b/addressbook/gui/component/addressbook.c
index cbf908c17f..dbeccd75fc 100644
--- a/addressbook/gui/component/addressbook.c
+++ b/addressbook/gui/component/addressbook.c
@@ -120,7 +120,8 @@ load_source_auth_cb (EBook *book, EBookStatus status, gpointer closure)
}
}
- data->cb (book, status, data->closure);
+ if (data->cb)
+ data->cb (book, status, data->closure);
free_load_source_data (data);
}
@@ -209,12 +210,28 @@ addressbook_authenticate (EBook *book, gboolean previous_failure, ESource *sourc
}
else {
/* they hit cancel */
- cb (book, E_BOOK_ERROR_CANCELLED, closure);
+
+ cb (book, E_BOOK_ERROR_CANCELLED, closure);
}
g_free (uri);
}
+
+
+static void
+auth_required_cb (EBook *book, gpointer data)
+{
+ LoadSourceData *load_source_data = g_new0(LoadSourceData, 1);
+
+ load_source_data->source = g_object_ref (g_object_ref (e_book_get_source (book)));
+ load_source_data->cancelled = FALSE;
+ addressbook_authenticate (book, FALSE, load_source_data->source,
+ load_source_auth_cb, load_source_data);
+
+
+
+}
static void
load_source_cb (EBook *book, EBookStatus status, gpointer closure)
{
@@ -229,17 +246,16 @@ load_source_cb (EBook *book, EBookStatus status, gpointer closure)
const gchar *auth;
auth = e_source_get_property (load_source_data->source, "auth");
-
- /* check if the addressbook needs authentication */
-
if (auth && strcmp (auth, "none")) {
- addressbook_authenticate (book, FALSE, load_source_data->source,
- load_source_auth_cb, closure);
-
- return;
+ g_signal_connect (book, "auth_required", auth_required_cb, NULL);
+
+ if (e_book_is_online (book)) {
+ addressbook_authenticate (book, FALSE, load_source_data->source,
+ load_source_auth_cb, closure);
+ return;
+ }
}
}
-
load_source_data->cb (book, status, load_source_data->closure);
free_load_source_data (load_source_data);
}