diff options
author | Matthew Barnes <mbarnes@src.gnome.org> | 2008-09-11 23:34:29 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@src.gnome.org> | 2008-09-11 23:34:29 +0800 |
commit | c0a255eb90769638d57ae4122932f75c46e4e531 (patch) | |
tree | 5213694107a246763c25c0a089553dd7c8708b32 /plugins/google-account-setup | |
parent | 4c8aa5982c0132716f473873d0e1d7601df14607 (diff) | |
download | gsoc2013-evolution-c0a255eb90769638d57ae4122932f75c46e4e531.tar gsoc2013-evolution-c0a255eb90769638d57ae4122932f75c46e4e531.tar.gz gsoc2013-evolution-c0a255eb90769638d57ae4122932f75c46e4e531.tar.bz2 gsoc2013-evolution-c0a255eb90769638d57ae4122932f75c46e4e531.tar.lz gsoc2013-evolution-c0a255eb90769638d57ae4122932f75c46e4e531.tar.xz gsoc2013-evolution-c0a255eb90769638d57ae4122932f75c46e4e531.tar.zst gsoc2013-evolution-c0a255eb90769638d57ae4122932f75c46e4e531.zip |
Merge revisions 36016:36303 from trunk.
svn path=/branches/kill-bonobo/; revision=36307
Diffstat (limited to 'plugins/google-account-setup')
-rw-r--r-- | plugins/google-account-setup/ChangeLog | 14 | ||||
-rw-r--r-- | plugins/google-account-setup/google-source.c | 88 |
2 files changed, 31 insertions, 71 deletions
diff --git a/plugins/google-account-setup/ChangeLog b/plugins/google-account-setup/ChangeLog index 3f37cde680..c8e97a9e6b 100644 --- a/plugins/google-account-setup/ChangeLog +++ b/plugins/google-account-setup/ChangeLog @@ -1,3 +1,17 @@ +2008-08-27 Sankar P <psankar@novell.com> + +License Changes + + * google-source.c: + +2008-08-20 Milan Crha <mcrha@redhat.com> + + ** Fix for bug #525555 + + * google-source.c: (print_uri_noproto): Removed. + * google-source.c: (user_changed): Do not leak. + * google-source.c: (plugin_google): Get username from source, not URL. + 2008-08-14 Jörgen Scheibengruber <mfcn@gmx.de> * google-contacts-source.c (on_ssl_cb_toggled), diff --git a/plugins/google-account-setup/google-source.c b/plugins/google-account-setup/google-source.c index 57727c6122..772d8a771a 100644 --- a/plugins/google-account-setup/google-source.c +++ b/plugins/google-account-setup/google-source.c @@ -1,23 +1,23 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ /* - * Authors : - * Ebby Wiselyn <ebbywiselyn@gmail.com> - * - * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) * * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU Lesser General Public - * License as published by the Free Software Foundation. + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) version 3. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with the program; if not, see <http://www.gnu.org/licenses/> * - * * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, - * Boston, MA 02110-1301, USA. + * + * Authors: + * Ebby Wiselyn <ebbywiselyn@gmail.com> + * + * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) * */ @@ -118,43 +118,6 @@ e_plugin_lib_enable (EPluginLib *ep, int enable) /********************************************************************************************************************/ -/* the location field for google sources */ -/* stolen from calendar-weather eplugin */ -static gchar * -print_uri_noproto (EUri *uri) -{ - gchar *uri_noproto; - - if (uri->port != 0) - uri_noproto = g_strdup_printf ( - "%s%s%s%s%s%s%s:%d%s%s%s", - uri->user ? uri->user : "", - uri->authmech ? ";auth=" : "", - uri->authmech ? uri->authmech : "", - uri->passwd ? ":" : "", - uri->passwd ? uri->passwd : "", - uri->user ? "@" : "", - uri->host ? uri->host : "", - uri->port, - uri->path ? uri->path : "", - uri->query ? "?" : "", - uri->query ? uri->query : ""); - else - uri_noproto = g_strdup_printf ( - "%s%s%s%s%s%s%s%s%s%s", - uri->user ? uri->user : "", - uri->authmech ? ";auth=" : "", - uri->authmech ? uri->authmech : "", - uri->passwd ? ":" : "", - uri->passwd ? uri->passwd : "", - uri->user ? "@" : "", - uri->host ? uri->host : "", - uri->path ? uri->path : "", - uri->query ? "?" : "", - uri->query ? uri->query : ""); - return uri_noproto; -} - #if 0 FIXME: Not sure why this function is declared but called no where. This needs fixing. @@ -264,22 +227,9 @@ static void init_combo_values (GtkComboBox *combo, const char *deftitle, const c static void user_changed (GtkEntry *editable, ESource *source) { - EUri *euri; char *uri; - char *ruri; const char *user; - uri = e_source_get_uri (source); - - if (uri == NULL) { - g_free (uri); - return; - } - - euri = e_uri_new (uri); - g_free (euri->user); - euri->user = NULL; - /* two reasons why set readonly to FALSE: a) the e_source_set_relative_uri does nothing for readonly sources b) we are going to set default uri, which should be always writeable */ @@ -290,7 +240,7 @@ user_changed (GtkEntry *editable, ESource *source) e_source_set_relative_uri (source, uri); g_free (uri); - e_source_set_property (source, "username", gtk_entry_get_text (GTK_ENTRY (editable))); + e_source_set_property (source, "username", user); e_source_set_property (source, "protocol", "google"); e_source_set_property (source, "auth-domain", "google"); e_source_set_property (source, "auth", (user && *user) ? "1" : NULL); @@ -299,10 +249,6 @@ user_changed (GtkEntry *editable, ESource *source) /* we changed user, thus reset the chosen calendar combo too, because other user means other calendars subscribed */ init_combo_values (GTK_COMBO_BOX (g_object_get_data (G_OBJECT (editable), "CalendarCombo")), _("Default"), NULL); - - ruri = print_uri_noproto (euri); - g_free (ruri); - e_uri_free (euri); } static char * @@ -623,7 +569,7 @@ plugin_google (EPlugin *epl, GtkWidget *label; GtkWidget *combo; char *uri; - char *username; + const char *username; const char *ssl_prop; gboolean ssl_enabled; int row; @@ -651,7 +597,8 @@ plugin_google (EPlugin *epl, return NULL; } - username = euri->user; + username = e_source_get_property (source, "username"); + g_free (euri->user); euri->user = NULL; uri = e_uri_to_string (euri, FALSE); @@ -742,7 +689,6 @@ plugin_google (EPlugin *epl, source); g_free (uri); - g_free (username); label = gtk_label_new_with_mnemonic (_("Cal_endar:")); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); |