[evolution/webkit] Adapt to CamelSession and e-passwords changes.



commit 953c257f1e390a37b190e1ad5c40ce9bab11694b
Author: Matthew Barnes <mbarnes redhat com>
Date:   Mon Jul 4 09:55:30 2011 -0400

    Adapt to CamelSession and e-passwords changes.

 calendar/gui/alarm-notify/alarm-notify.c     |    6 +-----
 calendar/gui/e-meeting-store.c               |    4 ++--
 capplet/settings/mail-account-view.c         |   10 +++++-----
 mail/e-mail-session.c                        |   14 ++++----------
 mail/em-account-editor.c                     |    7 +------
 plugins/caldav/caldav-browse-server.c        |    4 ++--
 plugins/google-account-setup/google-source.c |    2 +-
 plugins/publish-calendar/publish-calendar.c  |    4 ++--
 plugins/publish-calendar/publish-location.c  |    6 +++---
 plugins/publish-calendar/url-editor-dialog.c |    6 +++---
 smime/gui/component.c                        |    4 ++--
 smime/lib/e-pkcs12.c                         |    2 +-
 12 files changed, 27 insertions(+), 42 deletions(-)
---
diff --git a/calendar/gui/alarm-notify/alarm-notify.c b/calendar/gui/alarm-notify/alarm-notify.c
index 28b10ff..0de79ef 100644
--- a/calendar/gui/alarm-notify/alarm-notify.c
+++ b/calendar/gui/alarm-notify/alarm-notify.c
@@ -383,12 +383,8 @@ alarm_notify_add_calendar (AlarmNotify *an, ECalClientSourceType source_type,  E
 	   session skip this source loading. we do not really want to prompt for auth from alarm dameon*/
 
 	if (e_source_get_property (source, "auth")) {
-		const gchar *name = e_source_get_property (source, "auth-domain");
 
-		if (!name)
-			name = "Calendar";
-
-		if (!e_passwords_get_password (name, pass_key)) {
+		if (!e_passwords_get_password (NULL, pass_key)) {
 			g_mutex_unlock (an->priv->mutex);
 			g_free (str_uri);
 			g_free (pass_key);
diff --git a/calendar/gui/e-meeting-store.c b/calendar/gui/e-meeting-store.c
index ca4df0b..5395803 100644
--- a/calendar/gui/e-meeting-store.c
+++ b/calendar/gui/e-meeting-store.c
@@ -1809,7 +1809,7 @@ soup_authenticate (SoupSession *session,
 		} else {
 			gchar *password;
 
-			password = e_passwords_get_password ("Calendar", orig_uri);
+			password = e_passwords_get_password (NULL, orig_uri);
 			if (password) {
 				soup_auth_authenticate (auth, suri->user, password);
 				tried = TRUE;
@@ -1846,7 +1846,7 @@ soup_authenticate (SoupSession *session,
 		}
 
 		password = e_passwords_ask_password (
-			_("Enter password"), "Calendar", orig_uri,
+			_("Enter password"), NULL, orig_uri,
 			description->str, E_PASSWORDS_REMEMBER_FOREVER |
 			E_PASSWORDS_SECRET | E_PASSWORDS_ONLINE |
 			(retrying ? E_PASSWORDS_REPROMPT : 0),
diff --git a/capplet/settings/mail-account-view.c b/capplet/settings/mail-account-view.c
index 6328dbc..0290cd7 100644
--- a/capplet/settings/mail-account-view.c
+++ b/capplet/settings/mail-account-view.c
@@ -278,7 +278,7 @@ setup_yahoo_account (MailAccountView *mav)
 
 		abs_uri = g_strdup_printf ("caldav://%s caldav calendar yahoo com/dav/%s/Calendar/%s/", sanitize_uname, email,  gtk_entry_get_text((GtkEntry *)mav->priv->yahoo_cal_entry));
 		e_passwords_add_password (abs_uri, gtk_entry_get_text ((GtkEntry *) mav->password));
-		e_passwords_remember_password ("Calendar", abs_uri);
+		e_passwords_remember_password (NULL, abs_uri);
 
 		rel_uri = g_strdup_printf (YAHOO_CALENDAR_LOCATION, sanitize_uname, email, gtk_entry_get_text ((GtkEntry *) mav->priv->yahoo_cal_entry));
 		e_source_set_relative_uri (calendar, rel_uri);
@@ -328,7 +328,7 @@ setup_yahoo_account (MailAccountView *mav)
 
 		rel_uri = g_strdup_printf("google://%s/", mav->priv->username);
 		e_passwords_add_password (rel_uri, gtk_entry_get_text ((GtkEntry *) mav->password));
-		e_passwords_remember_password ("Addressbook", rel_uri);
+		e_passwords_remember_password (NULL, rel_uri);
 		e_source_group_add_source (sgrp, abook, -1);
 		e_source_list_sync (slist, NULL);
 
@@ -379,7 +379,7 @@ setup_google_accounts (MailAccountView *mav)
 		e_source_set_absolute_uri (calendar, abs_uri);
 
 		e_passwords_add_password (abs_uri, gtk_entry_get_text ((GtkEntry *) mav->password));
-		e_passwords_remember_password ("Calendar", abs_uri);
+		e_passwords_remember_password (NULL, abs_uri);
 		rel_uri = g_strconcat ("https", GMAIL_CALENDAR_LOCATION, sanitize_uname, CALENDAR_DEFAULT_PATH, NULL);
 		e_source_set_relative_uri (calendar, rel_uri);
 
@@ -447,7 +447,7 @@ setup_google_accounts (MailAccountView *mav)
 
 			rel_uri = g_strdup_printf ("google://%s/", mav->priv->username);
 			e_passwords_add_password (rel_uri, gtk_entry_get_text ((GtkEntry *) mav->password));
-			e_passwords_remember_password ("Addressbook", rel_uri);
+			e_passwords_remember_password (NULL, rel_uri);
 			e_source_list_sync (slist, NULL);
 
 			g_free (rel_uri);
@@ -688,7 +688,7 @@ mav_next_pressed (GtkButton *button, MailAccountView *mav)
 			aurl = camel_url_new (account->source->url, NULL);
 			surl = camel_url_to_string (aurl, CAMEL_URL_HIDE_ALL);
 			e_passwords_add_password (surl, gtk_entry_get_text ((GtkEntry *) mav->password));
-			e_passwords_remember_password ("Mail", surl);
+			e_passwords_remember_password (NULL, surl);
 			camel_url_free (aurl);
 			g_free (surl);
 		}
diff --git a/mail/e-mail-session.c b/mail/e-mail-session.c
index 1a3b9e8..44bbd8d 100644
--- a/mail/e-mail-session.c
+++ b/mail/e-mail-session.c
@@ -609,7 +609,6 @@ mail_session_finalize (GObject *object)
 static gchar *
 mail_session_get_password (CamelSession *session,
                            CamelService *service,
-                           const gchar *domain,
                            const gchar *prompt,
                            const gchar *item,
                            guint32 flags,
@@ -631,10 +630,7 @@ mail_session_get_password (CamelSession *session,
 		gchar *key = mail_session_make_key (service, item);
 		EAccountService *config_service = NULL;
 
-		if (domain == NULL)
-			domain = "Mail";
-
-		ret = e_passwords_get_password (domain, key);
+		ret = e_passwords_get_password (NULL, key);
 		if (ret == NULL || (flags & CAMEL_SESSION_PASSWORD_REPROMPT)) {
 			gboolean remember;
 
@@ -696,11 +692,11 @@ mail_session_get_password (CamelSession *session,
 					eflags |= E_PASSWORDS_DISABLE_REMEMBER;
 
 				ret = e_passwords_ask_password (
-					title, domain, key, prompt,
+					title, NULL, key, prompt,
 					eflags, &remember, NULL);
 
 				if (!ret)
-					e_passwords_forget_password (domain, key);
+					e_passwords_forget_password (NULL, key);
 
 				g_free (title);
 
@@ -729,16 +725,14 @@ mail_session_get_password (CamelSession *session,
 static gboolean
 mail_session_forget_password (CamelSession *session,
                               CamelService *service,
-                              const gchar *domain,
                               const gchar *item,
                               GError **error)
 {
 	gchar *key;
 
-	domain = (domain != NULL) ? domain : "Mail";
 	key = mail_session_make_key (service, item);
 
-	e_passwords_forget_password (domain, key);
+	e_passwords_forget_password (NULL, key);
 
 	g_free (key);
 
diff --git a/mail/em-account-editor.c b/mail/em-account-editor.c
index c6bef76..867a837 100644
--- a/mail/em-account-editor.c
+++ b/mail/em-account-editor.c
@@ -3838,19 +3838,14 @@ forget_password_if_needed (EAccount *original_account, EAccount *modified_accoun
 	    (orig_url && !modif_url)) {
 		CamelURL *url;
 		gchar *url_str;
-		const gchar *auth_domain;
 
 		url = camel_url_new (orig_url, NULL);
 		if (!url)
 			return;
 
-		auth_domain = camel_url_get_param (url, "auth-domain");
-		if (!auth_domain)
-			auth_domain = "Mail";
-
 		url_str = camel_url_to_string (url, CAMEL_URL_HIDE_PASSWORD | CAMEL_URL_HIDE_PARAMS);
 		if (url_str)
-			e_passwords_forget_password (auth_domain, url_str);
+			e_passwords_forget_password (NULL, url_str);
 
 		g_free (url_str);
 		camel_url_free (url);
diff --git a/plugins/caldav/caldav-browse-server.c b/plugins/caldav/caldav-browse-server.c
index d169dda..72985f4 100644
--- a/plugins/caldav/caldav-browse-server.c
+++ b/plugins/caldav/caldav-browse-server.c
@@ -891,7 +891,7 @@ soup_authenticate (SoupSession *session, SoupMessage *msg, SoupAuth *auth, gbool
 		return;
 
 	if (!retrying && !password)
-		password = e_passwords_get_password ("Calendar", g_object_get_data (dialog, "caldav-auth-key"));
+		password = e_passwords_get_password (NULL, g_object_get_data (dialog, "caldav-auth-key"));
 
 	if (!password || !*password || retrying) {
 		gchar *pass, *prompt, *add = NULL;
@@ -918,7 +918,7 @@ soup_authenticate (SoupSession *session, SoupMessage *msg, SoupAuth *auth, gbool
 		}
 
 		pass = e_passwords_ask_password (_("Enter password"),
-			"Calendar", g_object_get_data (dialog, "caldav-auth-key"), prompt,
+			NULL, g_object_get_data (dialog, "caldav-auth-key"), prompt,
 			E_PASSWORDS_REMEMBER_NEVER | E_PASSWORDS_DISABLE_REMEMBER | E_PASSWORDS_SECRET,
 			NULL, GTK_WINDOW (dialog));
 
diff --git a/plugins/google-account-setup/google-source.c b/plugins/google-account-setup/google-source.c
index 1e54362..5643c4f 100644
--- a/plugins/google-account-setup/google-source.c
+++ b/plugins/google-account-setup/google-source.c
@@ -441,7 +441,7 @@ retrieve_list_clicked (GtkButton *button, GtkComboBox *combo)
 
 	user = decode_at_back (username);
 	tmp = g_strdup_printf (_("Enter password for user %s to access list of subscribed calendars."), user);
-	password = e_passwords_ask_password (_("Enter password"), "Calendar", "", tmp,
+	password = e_passwords_ask_password (_("Enter password"), NULL, "", tmp,
 			E_PASSWORDS_REMEMBER_NEVER | E_PASSWORDS_REPROMPT | E_PASSWORDS_SECRET | E_PASSWORDS_DISABLE_REMEMBER,
 			NULL, parent);
 	g_free (tmp);
diff --git a/plugins/publish-calendar/publish-calendar.c b/plugins/publish-calendar/publish-calendar.c
index 3ea3747..8fad76f 100644
--- a/plugins/publish-calendar/publish-calendar.c
+++ b/plugins/publish-calendar/publish-calendar.c
@@ -322,14 +322,14 @@ ask_password (GMountOperation *op, const gchar *message, const gchar *default_us
 
 	euri = e_uri_new (ms->uri->location);
 	username = euri->user;
-	password = e_passwords_get_password ("Calendar", ms->uri->location);
+	password = e_passwords_get_password (NULL, ms->uri->location);
 	req_pass = ((username && *username) && !(ms->uri->service_type == TYPE_ANON_FTP &&
 			!strcmp (username, "anonymous"))) ? TRUE:FALSE;
 
 	if (!password && req_pass) {
 		gboolean remember = FALSE;
 
-		password = e_passwords_ask_password (_("Enter password"), "", ms->uri->location, message,
+		password = e_passwords_ask_password (_("Enter password"), NULL, ms->uri->location, message,
 					     E_PASSWORDS_REMEMBER_FOREVER|E_PASSWORDS_SECRET|E_PASSWORDS_ONLINE,
 					     &remember,
 					     NULL);
diff --git a/plugins/publish-calendar/publish-location.c b/plugins/publish-calendar/publish-location.c
index af539dd..9089561 100644
--- a/plugins/publish-calendar/publish-location.c
+++ b/plugins/publish-calendar/publish-location.c
@@ -88,11 +88,11 @@ migrateURI (const gchar *xml, xmlDocPtr doc)
 		uri->publish_frequency = atoi ((gchar *) frequency);
 	uri->publish_format = URI_PUBLISH_AS_FB;
 
-	password = e_passwords_get_password ("Calendar", (gchar *)location);
+	password = e_passwords_get_password (NULL, (gchar *)location);
 	if (password) {
-		e_passwords_forget_password ("Calendar", (gchar *)location);
+		e_passwords_forget_password (NULL, (gchar *)location);
 		e_passwords_add_password (uri->location, password);
-		e_passwords_remember_password ("Calendar", uri->location);
+		e_passwords_remember_password (NULL, uri->location);
 	}
 
 	for (p = root->children; p != NULL; p = p->next) {
diff --git a/plugins/publish-calendar/url-editor-dialog.c b/plugins/publish-calendar/url-editor-dialog.c
index 26d0a98..c2e68b9 100644
--- a/plugins/publish-calendar/url-editor-dialog.c
+++ b/plugins/publish-calendar/url-editor-dialog.c
@@ -437,7 +437,7 @@ url_editor_dialog_construct (UrlEditorDialog *dialog)
 		gtk_combo_box_set_active (GTK_COMBO_BOX (dialog->publish_frequency), uri->publish_frequency);
 		gtk_combo_box_set_active (GTK_COMBO_BOX (dialog->type_selector), uri->publish_format);
 
-		uri->password = e_passwords_get_password ("Calendar", uri->location);
+		uri->password = e_passwords_get_password (NULL, uri->location);
 		if (uri->password) {
 			if (strlen (uri->password) != 0) {
 				gtk_entry_set_text (GTK_ENTRY (dialog->password_entry), uri->password);
@@ -572,9 +572,9 @@ url_editor_dialog_run (UrlEditorDialog *dialog)
 
 		if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dialog->remember_pw))) {
 			e_passwords_add_password (dialog->uri->location, dialog->uri->password);
-			e_passwords_remember_password ("Calendar", dialog->uri->location);
+			e_passwords_remember_password (NULL, dialog->uri->location);
 		} else {
-			e_passwords_forget_password ("Calendar", dialog->uri->location);
+			e_passwords_forget_password (NULL, dialog->uri->location);
 		}
 
 		l = e_source_selector_get_selection (E_SOURCE_SELECTOR (dialog->events_selector));
diff --git a/smime/gui/component.c b/smime/gui/component.c
index 0b7a679..fbd6d75 100644
--- a/smime/gui/component.c
+++ b/smime/gui/component.c
@@ -46,7 +46,7 @@ smime_pk11_passwd (ECertDB *db, PK11SlotInfo* slot, gboolean retry, gchar **pass
 	prompt = g_strdup_printf (_("Enter the password for '%s'"), slot_name);
 	g_free (slot_name);
 
-	*passwd = e_passwords_ask_password (_("Enter password"), "SMIME-PKCS11", "",
+	*passwd = e_passwords_ask_password (_("Enter password"), NULL, "",
 					    prompt,
 					    E_PASSWORDS_REMEMBER_NEVER|E_PASSWORDS_SECRET, NULL,
 					    NULL);
@@ -68,7 +68,7 @@ smime_pk11_change_passwd (ECertDB *db, gchar **old_passwd, gchar **passwd, gpoin
 		/* we're setting the password initially */
 		prompt = _("Enter new password for certificate database");
 
-		*passwd = e_passwords_ask_password (_("Enter new password"), "SMIME-PKCS11", "",
+		*passwd = e_passwords_ask_password (_("Enter new password"), NULL, "",
 						    prompt,
 						    E_PASSWORDS_REMEMBER_NEVER|E_PASSWORDS_SECRET, NULL,
 						    NULL);
diff --git a/smime/lib/e-pkcs12.c b/smime/lib/e-pkcs12.c
index ed7e6a6..f4fa995 100644
--- a/smime/lib/e-pkcs12.c
+++ b/smime/lib/e-pkcs12.c
@@ -201,7 +201,7 @@ prompt_for_password (gchar *title, gchar *prompt, SECItem *pwd)
 {
 	gchar *passwd;
 
-	passwd = e_passwords_ask_password (title, "SMIME-PKCS12", "", prompt,
+	passwd = e_passwords_ask_password (title, NULL, "", prompt,
 					   E_PASSWORDS_REMEMBER_NEVER|E_PASSWORDS_SECRET, NULL,
 					   NULL);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]