aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui
diff options
context:
space:
mode:
authorSivaiah Nallagatla <snallagatla@novell.com>2005-04-08 21:12:58 +0800
committerSivaiah Nallagatla <siva@src.gnome.org>2005-04-08 21:12:58 +0800
commitd26b22c4da21f94749a3a40dd365fa131b9361e8 (patch)
tree5ed79f09b9c9ec836cb387667555998504364f70 /addressbook/gui
parent8d4a49fe281a22136757b160ba5edce68c3bd2cd (diff)
downloadgsoc2013-evolution-d26b22c4da21f94749a3a40dd365fa131b9361e8.tar.gz
gsoc2013-evolution-d26b22c4da21f94749a3a40dd365fa131b9361e8.tar.zst
gsoc2013-evolution-d26b22c4da21f94749a3a40dd365fa131b9361e8.zip
get the uri from Ebook instead of Esource. e_source_get_uri returns NULL
2005-04-04 Sivaiah Nallagatla <snallagatla@novell.com> * gui/component/addressbook.c (load_source_auth_cb) (addressbook_authenticate) : get the uri from Ebook instead of Esource. e_source_get_uri returns NULL when it does not have a reference to source group with it which happens when the source list from which this source was taken is destroyed but Ebook has reference to that source. e_book_get_uri returns the same uri and it will be always present Fixes #73330 svn path=/trunk/; revision=29190
Diffstat (limited to 'addressbook/gui')
-rw-r--r--addressbook/gui/component/addressbook.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/addressbook/gui/component/addressbook.c b/addressbook/gui/component/addressbook.c
index 4e5ad6ac8e..fa1fd8fb60 100644
--- a/addressbook/gui/component/addressbook.c
+++ b/addressbook/gui/component/addressbook.c
@@ -36,6 +36,7 @@
static void addressbook_authenticate (EBook *book, gboolean previous_failure,
ESource *source, EBookCallback cb, gpointer closure);
+static void auth_required_cb (EBook *book, gpointer data);
typedef struct {
EBookCallback cb;
@@ -56,7 +57,7 @@ free_load_source_data (LoadSourceData *data)
in uri*/
static gchar*
-remove_parameters_from_uri (gchar *uri)
+remove_parameters_from_uri (const gchar *uri)
{
gchar **components;
gchar *new_uri = NULL;
@@ -112,7 +113,7 @@ load_source_auth_cb (EBook *book, EBookStatus status, gpointer closure)
return;
} else {
- gchar *uri = e_source_get_uri (data->source);
+ const gchar *uri = e_book_get_uri (book);
gchar *stripped_uri = remove_parameters_from_uri (uri);
const gchar *auth_domain = e_source_get_property (data->source, "auth-domain");
const gchar *component_name;
@@ -123,7 +124,6 @@ load_source_auth_cb (EBook *book, EBookStatus status, gpointer closure)
addressbook_authenticate (book, TRUE, data->source, load_source_auth_cb, closure);
g_free (stripped_uri);
- g_free (uri);
return;
}
}
@@ -161,13 +161,12 @@ addressbook_authenticate (EBook *book, gboolean previous_failure, ESource *sourc
char *pass_dup = NULL;
const gchar *auth;
const gchar *user;
- gchar *uri = e_source_get_uri (source);
+ const gchar *uri = e_book_get_uri (book);
gchar *stripped_uri = remove_parameters_from_uri (uri);
const gchar *auth_domain = e_source_get_property (source, "auth-domain");
const gchar *component_name;
component_name = auth_domain ? auth_domain : "Addressbook";
- g_free (uri);
uri = stripped_uri;
password = e_passwords_get_password (component_name, uri);
@@ -222,8 +221,7 @@ 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);