[evolution-data-server] Diff noise reduction.



commit 6401157762d9f042a31414db7e3e34e0a1579a96
Author: Matthew Barnes <mbarnes redhat com>
Date:   Sat Apr 21 15:00:23 2012 -0400

    Diff noise reduction.
    
    Comparing 'master' and 'account-mgmt' branches.

 addressbook/backends/file/e-book-backend-file.c    |    8 +-
 .../backends/google/e-book-backend-google.c        |    8 +-
 addressbook/backends/ldap/e-book-backend-ldap.c    |   16 +-
 .../backends/webdav/e-book-backend-webdav.c        |   29 +++--
 addressbook/libebook/e-book-client.c               |    2 +
 addressbook/libebook/e-book.h                      |    6 +-
 addressbook/libedata-book/e-book-backend.c         |    7 +-
 calendar/backends/caldav/e-cal-backend-caldav.c    |   61 +++++---
 calendar/backends/file/e-cal-backend-file.c        |    7 +-
 calendar/backends/http/e-cal-backend-http.c        |   52 +++---
 calendar/backends/weather/e-cal-backend-weather.c  |   13 +-
 calendar/backends/weather/e-weather-source-ccf.c   |   64 ++++----
 calendar/libecal/e-cal.c                           |    8 +-
 calendar/libedata-cal/e-cal-backend-util.c         |   10 +-
 calendar/libedata-cal/e-cal-backend-util.h         |   13 +-
 calendar/libedata-cal/e-cal-backend.c              |   31 ++--
 calendar/libedata-cal/e-cal-backend.h              |    3 +-
 libedataserver/Makefile.am                         |    4 +-
 libedataserverui/e-book-auth-util.h                |    3 -
 libedataserverui/e-name-selector-dialog.c          |  170 ++++++++++---------
 libedataserverui/e-name-selector-entry.c           |   77 ++++++---
 libedataserverui/e-name-selector-list.c            |    2 +-
 libedataserverui/e-name-selector.c                 |    7 +-
 libedataserverui/e-source-combo-box.c              |   12 +-
 libedataserverui/e-source-selector-dialog.c        |   36 +++--
 libedataserverui/e-source-selector-dialog.h        |    4 +
 libedataserverui/e-source-selector.c               |    6 +-
 27 files changed, 376 insertions(+), 283 deletions(-)
---
diff --git a/addressbook/backends/file/e-book-backend-file.c b/addressbook/backends/file/e-book-backend-file.c
index d001d3e..9a5c6ea 100644
--- a/addressbook/backends/file/e-book-backend-file.c
+++ b/addressbook/backends/file/e-book-backend-file.c
@@ -1891,7 +1891,8 @@ e_book_backend_file_open (EBookBackendSync *backend,
 #endif
 
 	source = e_backend_get_source (E_BACKEND (backend));
-	dirname = e_book_backend_file_extract_path_from_source (source, GET_PATH_DB_DIR);
+	dirname = e_book_backend_file_extract_path_from_source (
+		source, GET_PATH_DB_DIR);
 	filename = g_build_filename (dirname, "addressbook.db", NULL);
 
 	db_error = e_db3_utils_maybe_recover (filename);
@@ -2120,7 +2121,8 @@ e_book_backend_file_open (EBookBackendSync *backend,
 	}
 
 	/* Resolve the photo directory here */
-	dirname = e_book_backend_file_extract_path_from_source (source, GET_PATH_PHOTO_DIR);
+	dirname = e_book_backend_file_extract_path_from_source (
+		source, GET_PATH_PHOTO_DIR);
 	if (!only_if_exists && !create_directory (dirname, perror))
 		return;
 	bf->priv->photo_dirname = dirname;
@@ -2202,7 +2204,7 @@ e_book_backend_file_remove (EBookBackendSync *backend,
 		while ((name = g_dir_read_name (dir))) {
 			if (select_changes (name)) {
 				gchar *full_path = g_build_filename (bf->priv->dirname, name, NULL);
-				if (-1 == g_unlink (full_path)) {
+				if (g_unlink (full_path) == -1) {
 					g_warning ("failed to remove change db `%s': %s", full_path, g_strerror (errno));
 				}
 				g_free (full_path);
diff --git a/addressbook/backends/google/e-book-backend-google.c b/addressbook/backends/google/e-book-backend-google.c
index b8e80fc..a6a45a5 100644
--- a/addressbook/backends/google/e-book-backend-google.c
+++ b/addressbook/backends/google/e-book-backend-google.c
@@ -63,7 +63,10 @@
 #define EDB_ERROR(_code) e_data_book_create_error (E_DATA_BOOK_STATUS_ ## _code, NULL)
 #define EDB_ERROR_EX(_code, _msg) e_data_book_create_error (E_DATA_BOOK_STATUS_ ## _code, _msg)
 
-G_DEFINE_TYPE (EBookBackendGoogle, e_book_backend_google, E_TYPE_BOOK_BACKEND)
+G_DEFINE_TYPE (
+	EBookBackendGoogle,
+	e_book_backend_google,
+	E_TYPE_BOOK_BACKEND)
 
 typedef enum {
 	NO_CACHE,
@@ -1275,8 +1278,7 @@ request_authorization (EBookBackend *backend)
 #ifdef HAVE_GOA
 	/* If we're using OAuth tokens, then as far as the backend
 	 * is concerned it's always authorized.  The GDataAuthorizer
-	 * will take care of everything in the background without
-	 * bothering clients with "auth-required" signals. */
+	 * will take care of everything in the background. */
 	if (E_IS_GDATA_GOA_AUTHORIZER (priv->authorizer))
 		return;
 #endif
diff --git a/addressbook/backends/ldap/e-book-backend-ldap.c b/addressbook/backends/ldap/e-book-backend-ldap.c
index 1518578..bcacebd 100644
--- a/addressbook/backends/ldap/e-book-backend-ldap.c
+++ b/addressbook/backends/ldap/e-book-backend-ldap.c
@@ -124,7 +124,7 @@
 #include <sys/time.h>
 
 #include <glib/gi18n-lib.h>
-#include "libedataserver/e-sexp.h"
+#include <libedataserver/e-sexp.h>
 #include <libebook/e-contact.h>
 
 #include <libedata-book/e-book-backend-sexp.h>
@@ -192,7 +192,7 @@ struct _EBookBackendLDAPPrivate {
 	gint      ldap_timeout; /* the search timeout */
 
 	gchar   *auth_dn;
-	gchar   *auth_passwd;
+	gchar   *auth_secret;
 
 	gboolean ldap_v3;      /* TRUE if the server supports protocol
                                   revision 3 (necessary for TLS) */
@@ -954,7 +954,7 @@ e_book_backend_ldap_connect (EBookBackendLDAP *bl,
 		 * authenticate the user properly later (in
 		 * authenticate_user) if they've selected
 		 * authentication */
-		ldap_error = ldap_simple_bind_s (blpriv->ldap, blpriv->auth_dn, blpriv->auth_passwd);
+		ldap_error = ldap_simple_bind_s (blpriv->ldap, blpriv->auth_dn, blpriv->auth_secret);
 		if (ldap_error == LDAP_PROTOCOL_ERROR) {
 			g_warning ("failed to bind using v3.  trying v2.");
 			/* server doesn't support v3 binds, so let's
@@ -964,7 +964,7 @@ e_book_backend_ldap_connect (EBookBackendLDAP *bl,
 			protocol_version = LDAP_VERSION2;
 			ldap_set_option (blpriv->ldap, LDAP_OPT_PROTOCOL_VERSION, &protocol_version);
 
-			ldap_error = ldap_simple_bind_s (blpriv->ldap, blpriv->auth_dn, blpriv->auth_passwd);
+			ldap_error = ldap_simple_bind_s (blpriv->ldap, blpriv->auth_dn, blpriv->auth_secret);
 		}
 
 		if (ldap_error == LDAP_PROTOCOL_ERROR) {
@@ -1111,7 +1111,7 @@ e_book_backend_ldap_reconnect (EBookBackendLDAP *bl,
 			g_static_rec_mutex_lock (&eds_ldap_handler_lock);
 			ldap_error = ldap_simple_bind_s (bl->priv->ldap,
 							bl->priv->auth_dn,
-							bl->priv->auth_passwd);
+							bl->priv->auth_secret);
 			g_static_rec_mutex_unlock (&eds_ldap_handler_lock);
 		}
 		book_view_notify_status (bl, book_view, "");
@@ -5211,10 +5211,10 @@ e_book_backend_ldap_authenticate_user (EBookBackend *backend,
 		}
 
 		g_free (bl->priv->auth_dn);
-		e_credentials_util_safe_free_string (bl->priv->auth_passwd);
+		e_credentials_util_safe_free_string (bl->priv->auth_secret);
 
 		bl->priv->auth_dn = dn;
-		bl->priv->auth_passwd = e_credentials_get (credentials, E_CREDENTIALS_KEY_PASSWORD);
+		bl->priv->auth_secret = e_credentials_get (credentials, E_CREDENTIALS_KEY_PASSWORD);
 
 		/* now authenticate against the DN we were either supplied or queried for */
 		if (enable_debug)
@@ -5234,7 +5234,7 @@ e_book_backend_ldap_authenticate_user (EBookBackend *backend,
 
 		ldap_error = ldap_simple_bind_s (bl->priv->ldap,
 						bl->priv->auth_dn,
-						bl->priv->auth_passwd);
+						bl->priv->auth_secret);
 		g_static_rec_mutex_unlock (&eds_ldap_handler_lock);
 		/* Some ldap servers are returning (ex active directory ones) LDAP_SERVER_DOWN
 		 * when we try to do an ldap operation  after being  idle
diff --git a/addressbook/backends/webdav/e-book-backend-webdav.c b/addressbook/backends/webdav/e-book-backend-webdav.c
index 8ae2ca8..f4efe3c 100644
--- a/addressbook/backends/webdav/e-book-backend-webdav.c
+++ b/addressbook/backends/webdav/e-book-backend-webdav.c
@@ -63,7 +63,10 @@
 #define WEBDAV_CLOSURE_NAME   "EBookBackendWebdav.BookView::closure"
 #define WEBDAV_CTAG_KEY "WEBDAV_CTAG"
 
-G_DEFINE_TYPE (EBookBackendWebdav, e_book_backend_webdav, E_TYPE_BOOK_BACKEND)
+G_DEFINE_TYPE (
+	EBookBackendWebdav,
+	e_book_backend_webdav,
+	E_TYPE_BOOK_BACKEND)
 
 struct _EBookBackendWebdavPrivate {
 	gboolean           marked_for_offline;
@@ -1229,8 +1232,12 @@ e_book_backend_webdav_authenticate_user (EBookBackend *backend,
 }
 
 /** authentication callback for libsoup */
-static void soup_authenticate (SoupSession *session, SoupMessage *message,
-                              SoupAuth *auth, gboolean retrying, gpointer data)
+static void
+soup_authenticate (SoupSession *session,
+                   SoupMessage *message,
+                   SoupAuth *auth,
+                   gboolean retrying,
+                   gpointer data)
 {
 	EBookBackendWebdav        *webdav = data;
 	EBookBackendWebdavPrivate *priv   = webdav->priv;
@@ -1363,13 +1370,16 @@ e_book_backend_webdav_open (EBookBackend *backend,
 	g_free (filename);
 
 	session = soup_session_sync_new ();
-	g_signal_connect(session, "authenticate", G_CALLBACK(soup_authenticate),
-			 webdav);
+	g_signal_connect (
+		session, "authenticate",
+		G_CALLBACK (soup_authenticate), webdav);
 
 	priv->session = session;
 	priv->proxy = e_proxy_new ();
 	e_proxy_setup_proxy (priv->proxy);
-	g_signal_connect (priv->proxy, "changed", G_CALLBACK (proxy_settings_changed), priv);
+	g_signal_connect (
+		priv->proxy, "changed",
+		G_CALLBACK (proxy_settings_changed), priv);
 	proxy_settings_changed (priv->proxy, priv);
 	webdav_debug_setup (priv->session);
 
@@ -1451,17 +1461,16 @@ e_book_backend_webdav_dispose (GObject *object)
 	EBookBackendWebdavPrivate *priv   = webdav->priv;
 
 	#define do_unref(x) { if (x) g_object_unref (x); x = NULL; }
-	#define do_free(x) { if (x) g_free (x); x = NULL; }
 
 	do_unref (priv->session);
 	do_unref (priv->proxy);
 	do_unref (priv->cache);
-	do_free (priv->uri);
-	do_free (priv->username);
+
+	g_free (priv->uri);
+	g_free (priv->username);
 	if (priv->password) { e_credentials_util_safe_free_string (priv->password); priv->password = NULL; }
 
 	#undef do_unref
-	#undef do_free
 
 	G_OBJECT_CLASS (e_book_backend_webdav_parent_class)->dispose (object);
 }
diff --git a/addressbook/libebook/e-book-client.c b/addressbook/libebook/e-book-client.c
index 729f191..9622696 100644
--- a/addressbook/libebook/e-book-client.c
+++ b/addressbook/libebook/e-book-client.c
@@ -26,6 +26,8 @@
 #include <glib/gi18n-lib.h>
 #include <gio/gio.h>
 
+#include <gconf/gconf-client.h>
+
 #include "libedataserver/e-data-server-util.h"
 #include "libedataserver/e-client-private.h"
 
diff --git a/addressbook/libebook/e-book.h b/addressbook/libebook/e-book.h
index f632d2b..70673ef 100644
--- a/addressbook/libebook/e-book.h
+++ b/addressbook/libebook/e-book.h
@@ -14,9 +14,9 @@
 /* e-book deprecated since 3.2, use e-book-client instead */
 #ifndef E_BOOK_DISABLE_DEPRECATED
 
-#include "libedataserver/e-list.h"
-#include "libedataserver/e-source.h"
-#include "libedataserver/e-source-list.h"
+#include <libedataserver/e-list.h>
+#include <libedataserver/e-source.h>
+#include <libedataserver/e-source-list.h>
 #include <libebook/e-contact.h>
 #include <libebook/e-book-query.h>
 #include <libebook/e-book-view.h>
diff --git a/addressbook/libedata-book/e-book-backend.c b/addressbook/libedata-book/e-book-backend.c
index e3a5712..a4d974e 100644
--- a/addressbook/libedata-book/e-book-backend.c
+++ b/addressbook/libedata-book/e-book-backend.c
@@ -214,10 +214,11 @@ e_book_backend_class_init (EBookBackendClass *class)
 		PROP_CACHE_DIR,
 		g_param_spec_string (
 			"cache-dir",
+			"Cache Dir",
+			"The backend's cache directory",
 			NULL,
-			NULL,
-			NULL,
-			G_PARAM_READWRITE));
+			G_PARAM_READWRITE |
+			G_PARAM_STATIC_STRINGS));
 }
 
 static void
diff --git a/calendar/backends/caldav/e-cal-backend-caldav.c b/calendar/backends/caldav/e-cal-backend-caldav.c
index cc7ebaf..57ee693 100644
--- a/calendar/backends/caldav/e-cal-backend-caldav.c
+++ b/calendar/backends/caldav/e-cal-backend-caldav.c
@@ -2541,12 +2541,14 @@ initialize_backend (ECalBackendCalDAV *cbdav,
 	g_return_val_if_fail (cbdav->priv->uri != NULL, FALSE);
 
 	/* remove trailing slashes... */
-	len = strlen (cbdav->priv->uri);
-	while (len--) {
-		if (cbdav->priv->uri[len] == '/') {
-			cbdav->priv->uri[len] = '\0';
-		} else {
-			break;
+	if (cbdav->priv->uri != NULL) {
+		len = strlen (cbdav->priv->uri);
+		while (len--) {
+			if (cbdav->priv->uri[len] == '/') {
+				cbdav->priv->uri[len] = '\0';
+			} else {
+				break;
+			}
 		}
 	}
 
@@ -2615,19 +2617,23 @@ proxy_settings_changed (EProxy *proxy,
 	g_object_set (priv->session, SOUP_SESSION_PROXY_URI, proxy_uri, NULL);
 }
 
-static void
+static gboolean
 open_calendar (ECalBackendCalDAV *cbdav,
                GError **error)
 {
 	gboolean server_unreachable = FALSE;
+	gboolean success;
 	GError *local_error = NULL;
 
-	g_return_if_fail (cbdav != NULL);
+	g_return_val_if_fail (cbdav != NULL, FALSE);
 
 	/* set forward proxy */
 	proxy_settings_changed (cbdav->priv->proxy, cbdav->priv);
 
-	if (caldav_server_open_calendar (cbdav, &server_unreachable, &local_error)) {
+	success = caldav_server_open_calendar (
+		cbdav, &server_unreachable, &local_error);
+
+	if (success) {
 		update_slave_cmd (cbdav->priv, SLAVE_SHOULD_WORK);
 		g_cond_signal (cbdav->priv->cond);
 
@@ -2640,10 +2646,14 @@ open_calendar (ECalBackendCalDAV *cbdav,
 			e_cal_backend_notify_error (E_CAL_BACKEND (cbdav), msg);
 			g_free (msg);
 			g_clear_error (&local_error);
+			success = TRUE;
 		}
-	} else if (local_error) {
-		g_propagate_error (error, local_error);
 	}
+
+	if (local_error != NULL)
+		g_propagate_error (error, local_error);
+
+	return success;
 }
 
 static void
@@ -2654,6 +2664,7 @@ caldav_do_open (ECalBackendSync *backend,
                 GError **perror)
 {
 	ECalBackendCalDAV        *cbdav;
+	gboolean opened = TRUE;
 	gboolean online;
 
 	cbdav = E_CAL_BACKEND_CALDAV (backend);
@@ -2683,23 +2694,26 @@ caldav_do_open (ECalBackendSync *backend,
 	if (online) {
 		GError *local_error = NULL;
 
-		open_calendar (cbdav, &local_error);
+		opened = open_calendar (cbdav, &local_error);
 
 		if (g_error_matches (local_error, E_DATA_CAL_ERROR, AuthenticationRequired) || g_error_matches (local_error, E_DATA_CAL_ERROR, AuthenticationFailed)) {
 			g_clear_error (&local_error);
 			e_cal_backend_notify_auth_required (E_CAL_BACKEND (cbdav), TRUE, cbdav->priv->credentials);
-		} else {
-			e_cal_backend_notify_opened (E_CAL_BACKEND (backend), NULL);
+			opened = FALSE;
 		}
 
-		if (local_error)
+		if (local_error != NULL)
 			g_propagate_error (perror, local_error);
+
 	} else {
 		cbdav->priv->read_only = TRUE;
-		e_cal_backend_notify_opened (E_CAL_BACKEND (backend), NULL);
 	}
 
-	e_cal_backend_notify_readonly (E_CAL_BACKEND (backend), cbdav->priv->read_only);
+	if (opened)
+		e_cal_backend_notify_opened (E_CAL_BACKEND (backend), NULL);
+
+	e_cal_backend_notify_readonly (
+		E_CAL_BACKEND (backend), cbdav->priv->read_only);
 	e_cal_backend_notify_online (E_CAL_BACKEND (backend), online);
 
 	g_mutex_unlock (cbdav->priv->busy_lock);
@@ -4111,7 +4125,8 @@ process_object (ECalBackendCalDAV *cbdav,
 	case ICAL_METHOD_PUBLISH:
 	case ICAL_METHOD_REQUEST:
 	case ICAL_METHOD_REPLY:
-		is_declined = e_cal_backend_user_declined (e_cal_component_get_icalcomponent (ecomp));
+		is_declined = e_cal_backend_user_declined (
+			e_cal_component_get_icalcomponent (ecomp));
 		if (is_in_cache) {
 			if (!is_declined) {
 				GSList *new_components = NULL, *old_components = NULL;
@@ -4560,9 +4575,10 @@ caldav_get_free_busy (ECalBackendSync *backend,
 	ECalComponentDateTime dt;
 	struct icaltimetype dtvalue;
 	icaltimezone *utc;
-	gchar *str, *usermail;
+	gchar *str;
 	const GSList *u;
 	GSList *attendees = NULL, *to_free = NULL;
+	gchar *usermail;
 	GError *err = NULL;
 
 	cbdav = E_CAL_BACKEND_CALDAV (backend);
@@ -4606,7 +4622,7 @@ caldav_get_free_busy (ECalBackendSync *backend,
 	e_cal_component_set_dtend (comp, &dt);
 
 	usermail = get_usermail (E_CAL_BACKEND (backend));
-	if (usermail && !*usermail) {
+	if (usermail != NULL && *usermail == '\0') {
 		g_free (usermail);
 		usermail = NULL;
 	}
@@ -4815,7 +4831,10 @@ caldav_source_changed_cb (ESource *source,
 /* ************************************************************************* */
 /* ***************************** GObject Foo ******************************* */
 
-G_DEFINE_TYPE (ECalBackendCalDAV, e_cal_backend_caldav, E_TYPE_CAL_BACKEND_SYNC)
+G_DEFINE_TYPE (
+	ECalBackendCalDAV,
+	e_cal_backend_caldav,
+	E_TYPE_CAL_BACKEND_SYNC)
 
 static void
 e_cal_backend_caldav_dispose (GObject *object)
diff --git a/calendar/backends/file/e-cal-backend-file.c b/calendar/backends/file/e-cal-backend-file.c
index 54eaf6f..55f8b29 100644
--- a/calendar/backends/file/e-cal-backend-file.c
+++ b/calendar/backends/file/e-cal-backend-file.c
@@ -910,7 +910,9 @@ refresh_thread_func (gpointer data)
 	g_return_val_if_fail (priv->custom_file != NULL, NULL);
 
 	file = g_file_new_for_path (priv->custom_file);
-	info = g_file_query_info (file, G_FILE_ATTRIBUTE_TIME_MODIFIED, G_FILE_QUERY_INFO_NONE, NULL, NULL);
+	info = g_file_query_info (
+		file, G_FILE_ATTRIBUTE_TIME_MODIFIED,
+		G_FILE_QUERY_INFO_NONE, NULL, NULL);
 	g_return_val_if_fail (info != NULL, NULL);
 
 	last_modified = g_file_info_get_attribute_uint64 (info, G_FILE_ATTRIBUTE_TIME_MODIFIED);
@@ -3491,10 +3493,9 @@ cal_backend_file_constructed (GObject *object)
 
 	filename = g_build_filename (
 		user_data_dir, component_type, mangled_source_dir, NULL);
-
 	e_cal_backend_set_cache_dir (backend, filename);
-
 	g_free (filename);
+
 	g_free (mangled_source_dir);
 }
 
diff --git a/calendar/backends/http/e-cal-backend-http.c b/calendar/backends/http/e-cal-backend-http.c
index ff7e2b1..46e4ca5 100644
--- a/calendar/backends/http/e-cal-backend-http.c
+++ b/calendar/backends/http/e-cal-backend-http.c
@@ -46,7 +46,10 @@
 #define EDC_ERROR(_code) e_data_cal_create_error (_code, NULL)
 #define EDC_ERROR_EX(_code, _msg) e_data_cal_create_error (_code, _msg)
 
-G_DEFINE_TYPE (ECalBackendHttp, e_cal_backend_http, E_TYPE_CAL_BACKEND_SYNC)
+G_DEFINE_TYPE (
+	ECalBackendHttp,
+	e_cal_backend_http,
+	E_TYPE_CAL_BACKEND_SYNC)
 
 /* Private part of the ECalBackendHttp structure */
 struct _ECalBackendHttpPrivate {
@@ -72,12 +75,8 @@ struct _ECalBackendHttpPrivate {
 	ECredentials *credentials;
 };
 
-
-
 #define d(x)
 
-static void e_cal_backend_http_dispose (GObject *object);
-static void e_cal_backend_http_finalize (GObject *object);
 static gboolean begin_retrieval_cb (ECalBackendHttp *cbhttp);
 static void e_cal_backend_http_add_timezone (ECalBackendSync *backend, EDataCal *cal, GCancellable *cancellable, const gchar *tzobj, GError **perror);
 
@@ -106,7 +105,9 @@ e_cal_backend_http_dispose (GObject *object)
 	priv->credentials = NULL;
 
 	if (priv->source_changed_id) {
-		g_signal_handler_disconnect (e_backend_get_source (E_BACKEND (cbhttp)), priv->source_changed_id);
+		g_signal_handler_disconnect (
+			e_backend_get_source (E_BACKEND (cbhttp)),
+			priv->source_changed_id);
 		priv->source_changed_id = 0;
 	}
 
@@ -135,8 +136,6 @@ e_cal_backend_http_finalize (GObject *object)
 	G_OBJECT_CLASS (e_cal_backend_http_parent_class)->finalize (object);
 }
 
-
-
 /* Calendar backend methods */
 
 static gboolean
@@ -376,12 +375,12 @@ retrieval_done (SoupSession *session,
 
 	/* Handle redirection ourselves */
 	if (SOUP_STATUS_IS_REDIRECTION (msg->status_code)) {
-		newuri = soup_message_headers_get (msg->response_headers,
-						   "Location");
+		newuri = soup_message_headers_get (
+			msg->response_headers, "Location");
 
 		d(g_message ("Redirected from %s to %s\n", priv->uri, newuri));
 
-		if (newuri) {
+		if (newuri != NULL) {
 			if (newuri[0]=='/') {
 				g_warning ("Hey! Relative URI returned! Working around...\n");
 
@@ -432,7 +431,7 @@ retrieval_done (SoupSession *session,
 	if (priv->store) {
 		const gchar *etag = soup_message_headers_get_one (msg->response_headers, "ETag");
 
-		if (!etag || !*etag)
+		if (etag != NULL && *etag == '\0')
 			etag = NULL;
 
 		e_cal_backend_store_put_key_value (priv->store, "ETag", etag);
@@ -700,13 +699,9 @@ static void
 source_changed_cb (ESource *source,
                    ECalBackendHttp *cbhttp)
 {
-	ECalBackendHttpPrivate *priv;
-
 	g_return_if_fail (E_IS_CAL_BACKEND_HTTP (cbhttp));
 
-	priv = cbhttp->priv;
-
-	if (priv->uri) {
+	if (cbhttp->priv->uri != NULL) {
 		ESource *source;
 		const gchar *secure_prop;
 		gchar *new_uri;
@@ -718,12 +713,12 @@ source_changed_cb (ESource *source,
 			e_source_get_uri (source),
 			(secure_prop && g_str_equal(secure_prop, "1")));
 
-		if (new_uri && !g_str_equal (priv->uri, new_uri)) {
+		if (new_uri && !g_str_equal (cbhttp->priv->uri, new_uri)) {
 			/* uri changed, do reload some time soon */
-			g_free (priv->uri);
-			priv->uri = NULL;
+			g_free (cbhttp->priv->uri);
+			cbhttp->priv->uri = NULL;
 
-			if (!priv->is_loading)
+			if (!cbhttp->priv->is_loading)
 				g_idle_add ((GSourceFunc) begin_retrieval_cb, cbhttp);
 		}
 
@@ -757,7 +752,9 @@ e_cal_backend_http_open (ECalBackendSync *backend,
 	source = e_backend_get_source (E_BACKEND (backend));
 
 	if (priv->source_changed_id == 0) {
-		priv->source_changed_id = g_signal_connect (source, "changed", G_CALLBACK (source_changed_cb), cbhttp);
+		priv->source_changed_id = g_signal_connect (
+			source, "changed",
+			G_CALLBACK (source_changed_cb), cbhttp);
 	}
 
 	/* always read uri again */
@@ -765,7 +762,7 @@ e_cal_backend_http_open (ECalBackendSync *backend,
 	priv->uri = NULL;
 	g_free (tmp);
 
-	if (!priv->store) {
+	if (priv->store == NULL) {
 		const gchar *cache_dir;
 
 		cache_dir = e_cal_backend_get_cache_dir (E_CAL_BACKEND (backend));
@@ -776,8 +773,13 @@ e_cal_backend_http_open (ECalBackendSync *backend,
 		e_cal_backend_store_load (priv->store);
 
 		if (!priv->store) {
-			g_propagate_error (perror, EDC_ERROR_EX (OtherError, _("Could not create cache file")));
-			e_cal_backend_notify_opened (E_CAL_BACKEND (backend), EDC_ERROR_EX (OtherError, _("Could not create cache file")));
+			g_propagate_error (
+				perror, EDC_ERROR_EX (OtherError,
+				_("Could not create cache file")));
+			e_cal_backend_notify_opened (
+				E_CAL_BACKEND (backend),
+				EDC_ERROR_EX (OtherError,
+				_("Could not create cache file")));
 			return;
 		}
 	}
diff --git a/calendar/backends/weather/e-cal-backend-weather.c b/calendar/backends/weather/e-cal-backend-weather.c
index cc875b2..bcd4329 100644
--- a/calendar/backends/weather/e-cal-backend-weather.c
+++ b/calendar/backends/weather/e-cal-backend-weather.c
@@ -127,12 +127,13 @@ maybe_start_reload_timeout (ECalBackendWeather *cbw)
 
 	refresh_str = e_source_get_property (source, "refresh");
 
-	/* By default, reload every 4 hours. At least for CCF, the forecasts only come out
-	 * twice a day, and chances are while the NWS and similar organizations have some
-	 * serious bandwidth, they would appreciate it if we didn't hammer their servers
-	 */
-	priv->reload_timeout_id = g_timeout_add ((refresh_str ? atoi (refresh_str) : 240) * 60000,
-						 (GSourceFunc) reload_cb, cbw);
+	/* By default, reload every 4 hours. At least for CCF, the forecasts
+	 * only come out twice a day, and chances are while the NWS and similar
+	 * organizations have some serious bandwidth, they would appreciate it
+	 * if we didn't hammer their servers. */
+	priv->reload_timeout_id = g_timeout_add (
+		(refresh_str ? atoi (refresh_str) : 240) * 60000,
+		(GSourceFunc) reload_cb, cbw);
 
 }
 
diff --git a/calendar/backends/weather/e-weather-source-ccf.c b/calendar/backends/weather/e-weather-source-ccf.c
index 3055e4c..a5c23b5 100644
--- a/calendar/backends/weather/e-weather-source-ccf.c
+++ b/calendar/backends/weather/e-weather-source-ccf.c
@@ -118,38 +118,6 @@ done:
 	return search.location;
 }
 
-EWeatherSource *
-e_weather_source_ccf_new (const gchar *uri)
-{
-	/* Old URI is formatted as weather://ccf/AAA[/BBB] - AAA is the 3-letter station
-	 * code for identifying the providing station (subdirectory within the crh data
-	 * repository). BBB is an optional additional station ID for the station within
-	 * the CCF file. If not present, BBB is assumed to be the same station as AAA.
-	 * But the new URI is as weather://code/name, where code is 4-letter code.
-	 * So if got the old URI, then migrate to the new one, if possible.
-	 */
-
-	WeatherLocation *wl;
-	EWeatherSourceCCF *source;
-
-	if (!uri)
-		return NULL;
-
-	if (strncmp (uri, "ccf/", 4) == 0)
-		wl = find_location (uri + 4, TRUE);
-	else
-		wl = find_location (uri, FALSE);
-
-	if (!wl)
-		return NULL;
-
-	source = E_WEATHER_SOURCE_CCF (g_object_new (e_weather_source_ccf_get_type (), NULL));
-	source->location = wl;
-	source->info = NULL;
-
-	return E_WEATHER_SOURCE (source);
-}
-
 #if 0
 static GSList *
 tokenize (gchar *buffer)
@@ -467,3 +435,35 @@ e_weather_source_ccf_init (EWeatherSourceCCF *source)
 	source->location = NULL;
 	source->info = NULL;
 }
+
+EWeatherSource *
+e_weather_source_ccf_new (const gchar *uri)
+{
+	/* Old URI is formatted as weather://ccf/AAA[/BBB] - AAA is the 3-letter station
+	 * code for identifying the providing station (subdirectory within the crh data
+	 * repository). BBB is an optional additional station ID for the station within
+	 * the CCF file. If not present, BBB is assumed to be the same station as AAA.
+	 * But the new URI is as weather://code/name, where code is 4-letter code.
+	 * So if got the old URI, then migrate to the new one, if possible.
+	 */
+
+	WeatherLocation *wl;
+	EWeatherSourceCCF *source;
+
+	if (uri == NULL)
+		return NULL;
+
+	if (strncmp (uri, "ccf/", 4) == 0)
+		wl = find_location (uri + 4, TRUE);
+	else
+		wl = find_location (uri, FALSE);
+
+	if (wl == NULL)
+		return NULL;
+
+	source = g_object_new (E_TYPE_WEATHER_SOURCE_CCF, NULL);
+	source->location = wl;
+	source->info = NULL;
+
+	return E_WEATHER_SOURCE (source);
+}
diff --git a/calendar/libecal/e-cal.c b/calendar/libecal/e-cal.c
index 9d99dd6..7533fb9 100644
--- a/calendar/libecal/e-cal.c
+++ b/calendar/libecal/e-cal.c
@@ -1645,9 +1645,7 @@ e_cal_open (ECal *ecal,
 	GError *err = NULL;
 	gboolean result;
 
-	result = open_calendar (ecal, only_if_exists, &err,
-		&status,
-		FALSE, FALSE);
+	result = open_calendar (ecal, only_if_exists, &err, &status, FALSE, FALSE);
 	g_signal_emit (G_OBJECT (ecal), e_cal_signals[CAL_OPENED], 0, status);
 	g_signal_emit (G_OBJECT (ecal), e_cal_signals[CAL_OPENED_EX], 0, err);
 
@@ -1743,9 +1741,7 @@ e_cal_open_async (ECal *ecal,
 		break;
 	}
 
-	open_calendar (ecal, only_if_exists, &error,
-		&status,
-		FALSE, TRUE);
+	open_calendar (ecal, only_if_exists, &error, &status, FALSE, TRUE);
 
 	if (error)
 		async_report_idle (ecal, error);
diff --git a/calendar/libedata-cal/e-cal-backend-util.c b/calendar/libedata-cal/e-cal-backend-util.c
index 4adf829..43d11e1 100644
--- a/calendar/libedata-cal/e-cal-backend-util.c
+++ b/calendar/libedata-cal/e-cal-backend-util.c
@@ -32,8 +32,8 @@ static EAccountList *accounts;
 
 /**
  * e_cal_backend_mail_account_get_default:
- * @address: Placeholder for default address.
- * @name: Placeholder for name.
+ * @address: placeholder for default address
+ * @name: placeholder for name
  *
  * Retrieve the default mail account as stored in Evolution configuration.
  *
@@ -64,8 +64,8 @@ e_cal_backend_mail_account_get_default (gchar **address,
 
 /**
  * e_cal_backend_mail_account_is_valid:
- * @user: User name for the account to check.
- * @name: Placeholder for the account name.
+ * @user: user name for the account to check
+ * @name: placeholder for the account name
  *
  * Checks that a mail account is valid, and returns its name.
  *
@@ -143,7 +143,7 @@ is_attendee_declined (icalcomponent *icalcomp,
 
 /**
  * e_cal_backend_user_declined:
- * @icalcomp: Component where to check.
+ * @icalcomp: component where to check
  *
  * Returns: Whether icalcomp contains attendee with a mail same as any of
  *          configured enabled mail account and whether this user declined.
diff --git a/calendar/libedata-cal/e-cal-backend-util.h b/calendar/libedata-cal/e-cal-backend-util.h
index 55cc712..aad52be 100644
--- a/calendar/libedata-cal/e-cal-backend-util.h
+++ b/calendar/libedata-cal/e-cal-backend-util.h
@@ -30,11 +30,14 @@ G_BEGIN_DECLS
  * Functions for accessing mail configuration
  */
 
-gboolean e_cal_backend_mail_account_get_default (gchar **address, gchar **name);
-gboolean e_cal_backend_mail_account_is_valid (gchar *user, gchar **name);
-
-gboolean e_cal_backend_user_declined (icalcomponent *icalcomp);
+gboolean	e_cal_backend_mail_account_get_default
+						(gchar **address,
+						 gchar **name);
+gboolean	e_cal_backend_mail_account_is_valid
+						(gchar *user,
+						 gchar **name);
+gboolean	e_cal_backend_user_declined	(icalcomponent *icalcomp);
 
 G_END_DECLS
 
-#endif
+#endif /* E_CAL_BACKEND_UTIL_H */
diff --git a/calendar/libedata-cal/e-cal-backend.c b/calendar/libedata-cal/e-cal-backend.c
index cc0db26..661cb83 100644
--- a/calendar/libedata-cal/e-cal-backend.c
+++ b/calendar/libedata-cal/e-cal-backend.c
@@ -114,13 +114,6 @@ cal_backend_set_default_cache_dir (ECalBackend *backend)
 }
 
 static void
-cal_backend_set_kind (ECalBackend *backend,
-                      icalcomponent_kind kind)
-{
-	backend->priv->kind = kind;
-}
-
-static void
 cal_backend_get_backend_property (ECalBackend *backend,
                                   EDataCal *cal,
                                   guint32 opid,
@@ -164,6 +157,13 @@ cal_backend_set_backend_property (ECalBackend *backend,
 }
 
 static void
+cal_backend_set_kind (ECalBackend *backend,
+                      icalcomponent_kind kind)
+{
+	backend->priv->kind = kind;
+}
+
+static void
 cal_backend_set_property (GObject *object,
                           guint property_id,
                           const GValue *value,
@@ -175,6 +175,7 @@ cal_backend_set_property (GObject *object,
 				E_CAL_BACKEND (object),
 				g_value_get_string (value));
 			return;
+
 		case PROP_KIND:
 			cal_backend_set_kind (
 				E_CAL_BACKEND (object),
@@ -197,6 +198,7 @@ cal_backend_get_property (GObject *object,
 				value, e_cal_backend_get_cache_dir (
 				E_CAL_BACKEND (object)));
 			return;
+
 		case PROP_KIND:
 			g_value_set_ulong (
 				value, e_cal_backend_get_kind (
@@ -258,23 +260,26 @@ e_cal_backend_class_init (ECalBackendClass *class)
 		PROP_CACHE_DIR,
 		g_param_spec_string (
 			"cache-dir",
+			"Cache Dir",
+			"The backend's cache directory",
 			NULL,
-			NULL,
-			NULL,
-			G_PARAM_READWRITE));
+			G_PARAM_READWRITE |
+			G_PARAM_STATIC_STRINGS));
 
 	g_object_class_install_property (
 		object_class,
 		PROP_KIND,
 		g_param_spec_ulong (
 			"kind",
-			NULL,
-			NULL,
+			"Kind",
+			"The kind of iCalendar components "
+			"this backend manages",
 			ICAL_NO_COMPONENT,
 			ICAL_XLICMIMEPART_COMPONENT,
 			ICAL_NO_COMPONENT,
 			G_PARAM_READWRITE |
-			G_PARAM_CONSTRUCT_ONLY));
+			G_PARAM_CONSTRUCT_ONLY |
+			G_PARAM_STATIC_STRINGS));
 }
 
 static void
diff --git a/calendar/libedata-cal/e-cal-backend.h b/calendar/libedata-cal/e-cal-backend.h
index 542e614..8787115 100644
--- a/calendar/libedata-cal/e-cal-backend.h
+++ b/calendar/libedata-cal/e-cal-backend.h
@@ -179,7 +179,8 @@ struct _ECalBackendClass {
 
 GType		e_cal_backend_get_type			(void);
 
-icalcomponent_kind e_cal_backend_get_kind		(ECalBackend *backend);
+icalcomponent_kind
+		e_cal_backend_get_kind			(ECalBackend *backend);
 gboolean	e_cal_backend_is_opened			(ECalBackend *backend);
 gboolean	e_cal_backend_is_opening		(ECalBackend *backend);
 gboolean	e_cal_backend_is_readonly		(ECalBackend *backend);
diff --git a/libedataserver/Makefile.am b/libedataserver/Makefile.am
index 5b23112..564661e 100644
--- a/libedataserver/Makefile.am
+++ b/libedataserver/Makefile.am
@@ -1,5 +1,7 @@
 # The marshallers
-MARSHAL_GENERATED = e-gdbus-marshallers.c e-gdbus-marshallers.h
+MARSHAL_GENERATED = \
+	e-gdbus-marshallers.c \
+	e-gdbus-marshallers.h
 @EVO_MARSHAL_RULE@
 
 lib_LTLIBRARIES = libedataserver-1.2.la
diff --git a/libedataserverui/e-book-auth-util.h b/libedataserverui/e-book-auth-util.h
index 67e8056..7977b57 100644
--- a/libedataserverui/e-book-auth-util.h
+++ b/libedataserverui/e-book-auth-util.h
@@ -18,9 +18,6 @@
  * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  * Boston, MA 02110-1301, USA.
  *
- * Authors: Hans Petter Jansson <hpj novell com>
- *
- * Mostly taken from Evolution's addressbook/gui/component/addressbook.c
  */
 
 #ifndef E_BOOK_AUTH_UTIL_H
diff --git a/libedataserverui/e-name-selector-dialog.c b/libedataserverui/e-name-selector-dialog.c
index de80d1a..428764a 100644
--- a/libedataserverui/e-name-selector-dialog.c
+++ b/libedataserverui/e-name-selector-dialog.c
@@ -118,7 +118,7 @@ G_DEFINE_TYPE_WITH_CODE (
 		E_TYPE_EXTENSIBLE, NULL))
 
 static void
-e_name_selector_dialog_populate_categories (ENameSelectorDialog *name_selector_dialog)
+name_selector_dialog_populate_categories (ENameSelectorDialog *name_selector_dialog)
 {
 	GtkWidget *combo_box;
 	GList *category_list, *iter;
@@ -147,8 +147,37 @@ e_name_selector_dialog_populate_categories (ENameSelectorDialog *name_selector_d
 }
 
 static void
-e_name_selector_dialog_init (ENameSelectorDialog *name_selector_dialog)
+name_selector_dialog_dispose (GObject *object)
+{
+	remove_books (E_NAME_SELECTOR_DIALOG (object));
+	shutdown_name_selector_model (E_NAME_SELECTOR_DIALOG (object));
+
+	/* Chain up to parent's dispose() method. */
+	G_OBJECT_CLASS (e_name_selector_dialog_parent_class)->dispose (object);
+}
+
+static void
+name_selector_dialog_finalize (GObject *object)
 {
+	ENameSelectorDialogPrivate *priv;
+
+	priv = E_NAME_SELECTOR_DIALOG_GET_PRIVATE (object);
+
+	g_slist_foreach (priv->user_query_fields, (GFunc) g_free, NULL);
+	g_slist_free (priv->user_query_fields);
+
+	g_array_free (priv->sections, TRUE);
+	g_object_unref (priv->button_size_group);
+	g_object_unref (priv->dest_label_size_group);
+
+	/* Chain up to parent's finalize() method. */
+	G_OBJECT_CLASS (e_name_selector_dialog_parent_class)->finalize (object);
+}
+
+static void
+name_selector_dialog_constructed (GObject *object)
+{
+	ENameSelectorDialogPrivate *priv;
 	GtkTreeSelection  *contact_selection;
 	GtkTreeViewColumn *column;
 	GtkCellRenderer   *cell_renderer;
@@ -182,8 +211,10 @@ e_name_selector_dialog_init (ENameSelectorDialog *name_selector_dialog)
 	GtkWidget *status_message;
 	GtkWidget *source_combo;
 
-	name_selector_dialog->priv =
-		E_NAME_SELECTOR_DIALOG_GET_PRIVATE (name_selector_dialog);
+	priv = E_NAME_SELECTOR_DIALOG_GET_PRIVATE (object);
+
+	/* Chain up to parent's constructed() method. */
+	G_OBJECT_CLASS (e_name_selector_dialog_parent_class)->constructed (object);
 
 	name_selector_box = gtk_vbox_new (FALSE, 6);
 	gtk_widget_show (name_selector_box);
@@ -266,7 +297,7 @@ e_name_selector_dialog_init (ENameSelectorDialog *name_selector_dialog)
 	g_free (tmp_str);
 
 	scrolledwindow0 = gtk_scrolled_window_new (NULL, NULL);
-	name_selector_dialog->priv->contact_window = scrolledwindow0;
+	priv->contact_window = scrolledwindow0;
 	gtk_widget_show (scrolledwindow0);
 	gtk_box_pack_start (GTK_BOX (name_selector_box), scrolledwindow0,
 			    TRUE, TRUE, 0);
@@ -334,24 +365,24 @@ e_name_selector_dialog_init (ENameSelectorDialog *name_selector_dialog)
 		return;
 	}
 
-	gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (name_selector_dialog))), name_selector_box, TRUE, TRUE, 0);
+	gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (object))), name_selector_box, TRUE, TRUE, 0);
 
 	/* Store pointers to relevant widgets */
 
-	name_selector_dialog->priv->contact_view = GTK_TREE_VIEW (source_tree_view);
-	name_selector_dialog->priv->status_label = GTK_LABEL (status_message);
-	name_selector_dialog->priv->destination_box = GTK_BOX (destination_box);
-	name_selector_dialog->priv->search_entry = GTK_ENTRY (search);
-	name_selector_dialog->priv->category_combobox = combobox_category;
+	priv->contact_view = GTK_TREE_VIEW (source_tree_view);
+	priv->status_label = GTK_LABEL (status_message);
+	priv->destination_box = GTK_BOX (destination_box);
+	priv->search_entry = GTK_ENTRY (search);
+	priv->category_combobox = combobox_category;
 
 	/* Create size group for transfer buttons */
 
-	name_selector_dialog->priv->button_size_group =
+	priv->button_size_group =
 		gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
 
 	/* Create size group for destination labels */
 
-	name_selector_dialog->priv->dest_label_size_group =
+	priv->dest_label_size_group =
 		gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
 
 	/* Set up contacts view */
@@ -359,52 +390,51 @@ e_name_selector_dialog_init (ENameSelectorDialog *name_selector_dialog)
 	column = gtk_tree_view_column_new ();
 	cell_renderer = GTK_CELL_RENDERER (gtk_cell_renderer_text_new ());
 	gtk_tree_view_column_pack_start (column, cell_renderer, TRUE);
-	gtk_tree_view_column_set_cell_data_func (column, cell_renderer,
-						 (GtkTreeCellDataFunc) contact_column_formatter,
-						 name_selector_dialog, NULL);
+	gtk_tree_view_column_set_cell_data_func (
+		column, cell_renderer, (GtkTreeCellDataFunc)
+		contact_column_formatter, object, NULL);
 
-	selection = gtk_tree_view_get_selection (
-		name_selector_dialog->priv->contact_view);
+	selection = gtk_tree_view_get_selection (priv->contact_view);
 	gtk_tree_selection_set_mode (selection, GTK_SELECTION_MULTIPLE);
-	gtk_tree_view_append_column (
-		name_selector_dialog->priv->contact_view, column);
+	gtk_tree_view_append_column (priv->contact_view, column);
 	g_signal_connect_swapped (
-		name_selector_dialog->priv->contact_view, "row-activated",
-		G_CALLBACK (contact_activated), name_selector_dialog);
+		priv->contact_view, "row-activated",
+		G_CALLBACK (contact_activated), object);
 
 	/* Listen for changes to the contact selection */
 
-	contact_selection = gtk_tree_view_get_selection (
-		name_selector_dialog->priv->contact_view);
-	g_signal_connect_swapped (contact_selection, "changed",
-				  G_CALLBACK (contact_selection_changed), name_selector_dialog);
+	contact_selection = gtk_tree_view_get_selection (priv->contact_view);
+	g_signal_connect_swapped (
+		contact_selection, "changed",
+		G_CALLBACK (contact_selection_changed), object);
 
 	/* Set up our data structures */
 
-	name_selector_dialog->priv->name_selector_model =
-		e_name_selector_model_new ();
-	name_selector_dialog->priv->sections =
-		g_array_new (FALSE, FALSE, sizeof (Section));
+	priv->name_selector_model = e_name_selector_model_new ();
+	priv->sections = g_array_new (FALSE, FALSE, sizeof (Section));
 
-	setup_name_selector_model (name_selector_dialog);
+	setup_name_selector_model (E_NAME_SELECTOR_DIALOG (object));
 
 	/* Create source menu */
 
 	source_combo = e_source_combo_box_new (source_list);
 	g_signal_connect_swapped (
 		source_combo, "changed",
-		G_CALLBACK (source_changed), name_selector_dialog);
+		G_CALLBACK (source_changed), object);
 	g_object_unref (source_list);
 
 	gtk_label_set_mnemonic_widget (GTK_LABEL (AddressBookLabel), source_combo);
 	gtk_widget_show (source_combo);
 	gtk_box_pack_start (GTK_BOX (source_menu_box), source_combo, TRUE, TRUE, 0);
 
-	e_name_selector_dialog_populate_categories (name_selector_dialog);
+	name_selector_dialog_populate_categories (
+		E_NAME_SELECTOR_DIALOG (object));
 
 	/* Set up search-as-you-type signal */
 
-	g_signal_connect_swapped (search, "changed", G_CALLBACK (search_changed), name_selector_dialog);
+	g_signal_connect_swapped (
+		search, "changed",
+		G_CALLBACK (search_changed), object);
 
 	/* Display initial source */
 
@@ -412,53 +442,21 @@ e_name_selector_dialog_init (ENameSelectorDialog *name_selector_dialog)
 
 	/* Set up dialog defaults */
 
-	gtk_dialog_add_buttons (GTK_DIALOG (name_selector_dialog),
-				GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE,
-				NULL);
-
-	gtk_dialog_set_default_response (GTK_DIALOG (name_selector_dialog), GTK_RESPONSE_CLOSE);
-	gtk_window_set_modal            (GTK_WINDOW (name_selector_dialog), TRUE);
-	gtk_window_set_default_size     (GTK_WINDOW (name_selector_dialog), 700, -1);
-	gtk_window_set_resizable        (GTK_WINDOW (name_selector_dialog), TRUE);
-	gtk_container_set_border_width  (GTK_CONTAINER (name_selector_dialog), 4);
-	gtk_window_set_title            (GTK_WINDOW (name_selector_dialog), _("Select Contacts from Address Book"));
+	gtk_dialog_add_buttons (
+		GTK_DIALOG (object),
+		GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE,
+		NULL);
+
+	gtk_dialog_set_default_response (
+		GTK_DIALOG (object), GTK_RESPONSE_CLOSE);
+	gtk_window_set_modal (GTK_WINDOW (object), TRUE);
+	gtk_window_set_default_size (GTK_WINDOW (object), 700, -1);
+	gtk_window_set_resizable (GTK_WINDOW (object), TRUE);
+	gtk_container_set_border_width (GTK_CONTAINER (object), 4);
+	gtk_window_set_title (
+		GTK_WINDOW (object),
+		_("Select Contacts from Address Book"));
 	gtk_widget_grab_focus (search);
-}
-
-static void
-name_selector_dialog_dispose (GObject *object)
-{
-	remove_books (E_NAME_SELECTOR_DIALOG (object));
-	shutdown_name_selector_model (E_NAME_SELECTOR_DIALOG (object));
-
-	/* Chain up to parent's dispose() method. */
-	G_OBJECT_CLASS (e_name_selector_dialog_parent_class)->dispose (object);
-}
-
-static void
-name_selector_dialog_finalize (GObject *object)
-{
-	ENameSelectorDialogPrivate *priv;
-
-	priv = E_NAME_SELECTOR_DIALOG_GET_PRIVATE (object);
-
-	g_slist_foreach (priv->user_query_fields, (GFunc) g_free, NULL);
-	g_slist_free (priv->user_query_fields);
-
-	g_array_free (priv->sections, TRUE);
-	g_object_unref (priv->button_size_group);
-	g_object_unref (priv->dest_label_size_group);
-
-	/* Chain up to parent's finalize() method. */
-	G_OBJECT_CLASS (e_name_selector_dialog_parent_class)->finalize (object);
-}
-
-static void
-name_selector_dialog_constructed (GObject *object)
-{
-	/* Chain up to parent's constructed() method. */
-	G_OBJECT_CLASS (e_name_selector_dialog_parent_class)->
-		constructed (object);
 
 	e_extensible_load_extensions (E_EXTENSIBLE (object));
 }
@@ -476,6 +474,13 @@ e_name_selector_dialog_class_init (ENameSelectorDialogClass *class)
 	object_class->constructed = name_selector_dialog_constructed;
 }
 
+static void
+e_name_selector_dialog_init (ENameSelectorDialog *name_selector_dialog)
+{
+	name_selector_dialog->priv =
+		E_NAME_SELECTOR_DIALOG_GET_PRIVATE (name_selector_dialog);
+}
+
 /**
  * e_name_selector_dialog_new:
  *
@@ -486,7 +491,7 @@ e_name_selector_dialog_class_init (ENameSelectorDialogClass *class)
 ENameSelectorDialog *
 e_name_selector_dialog_new (void)
 {
-	  return g_object_new (E_TYPE_NAME_SELECTOR_DIALOG, NULL);
+	return g_object_new (E_TYPE_NAME_SELECTOR_DIALOG, NULL);
 }
 
 /* --------- *
@@ -997,6 +1002,9 @@ source_changed (ENameSelectorDialog *name_selector_dialog,
 	/* Remove any previous books being shown or loaded */
 	remove_books (name_selector_dialog);
 
+	if (source == NULL)
+		return;
+
 	cancellable = g_cancellable_new ();
 	name_selector_dialog->priv->cancellable = cancellable;
 
diff --git a/libedataserverui/e-name-selector-entry.c b/libedataserverui/e-name-selector-entry.c
index 62e5df1..6261187 100644
--- a/libedataserverui/e-name-selector-entry.c
+++ b/libedataserverui/e-name-selector-entry.c
@@ -3028,55 +3028,84 @@ e_name_selector_entry_init (ENameSelectorEntry *name_selector_entry)
 
 	/* Edit signals */
 
-	g_signal_connect (name_selector_entry, "insert-text", G_CALLBACK (user_insert_text), name_selector_entry);
-	g_signal_connect (name_selector_entry, "delete-text", G_CALLBACK (user_delete_text), name_selector_entry);
-	g_signal_connect (name_selector_entry, "focus-out-event", G_CALLBACK (user_focus_out), name_selector_entry);
-	g_signal_connect_after (name_selector_entry, "focus-in-event", G_CALLBACK (user_focus_in), name_selector_entry);
+	g_signal_connect (
+		name_selector_entry, "insert-text",
+		G_CALLBACK (user_insert_text), name_selector_entry);
+	g_signal_connect (
+		name_selector_entry, "delete-text",
+		G_CALLBACK (user_delete_text), name_selector_entry);
+	g_signal_connect (
+		name_selector_entry, "focus-out-event",
+		G_CALLBACK (user_focus_out), name_selector_entry);
+	g_signal_connect_after (
+		name_selector_entry, "focus-in-event",
+		G_CALLBACK (user_focus_in), name_selector_entry);
 
 	/* Drawing */
 
-	g_signal_connect (name_selector_entry, "draw", G_CALLBACK (draw_event), name_selector_entry);
+	g_signal_connect (
+		name_selector_entry, "draw",
+		G_CALLBACK (draw_event), name_selector_entry);
 
 	/* Activation: Complete current entry if possible */
 
-	g_signal_connect (name_selector_entry, "activate", G_CALLBACK (entry_activate), name_selector_entry);
+	g_signal_connect (
+		name_selector_entry, "activate",
+		G_CALLBACK (entry_activate), name_selector_entry);
 
 	/* Pop-up menu */
 
-	g_signal_connect (name_selector_entry, "button-press-event", G_CALLBACK (prepare_popup_destination), name_selector_entry);
-	g_signal_connect (name_selector_entry, "populate-popup", G_CALLBACK (populate_popup), name_selector_entry);
+	g_signal_connect (
+		name_selector_entry, "button-press-event",
+		G_CALLBACK (prepare_popup_destination), name_selector_entry);
+	g_signal_connect (
+		name_selector_entry, "populate-popup",
+		G_CALLBACK (populate_popup), name_selector_entry);
 
 	/* Clipboard signals */
-	g_signal_connect (name_selector_entry, "copy-clipboard", G_CALLBACK (copy_clipboard), name_selector_entry);
-	g_signal_connect (name_selector_entry, "cut-clipboard", G_CALLBACK (cut_clipboard), name_selector_entry);
+	g_signal_connect (
+		name_selector_entry, "copy-clipboard",
+		G_CALLBACK (copy_clipboard), name_selector_entry);
+	g_signal_connect (
+		name_selector_entry, "cut-clipboard",
+		G_CALLBACK (cut_clipboard), name_selector_entry);
 
 	/* Completion */
 
 	name_selector_entry->priv->email_generator = NULL;
 
 	name_selector_entry->priv->entry_completion = gtk_entry_completion_new ();
-	gtk_entry_completion_set_match_func (name_selector_entry->priv->entry_completion,
-				       (GtkEntryCompletionMatchFunc) completion_match_cb, NULL, NULL);
-	g_signal_connect_swapped (name_selector_entry->priv->entry_completion, "match-selected",
-			    G_CALLBACK (completion_match_selected), name_selector_entry);
+	gtk_entry_completion_set_match_func (
+		name_selector_entry->priv->entry_completion,
+		(GtkEntryCompletionMatchFunc) completion_match_cb, NULL, NULL);
+	g_signal_connect_swapped (
+		name_selector_entry->priv->entry_completion, "match-selected",
+		G_CALLBACK (completion_match_selected), name_selector_entry);
 
-	gtk_entry_set_completion (GTK_ENTRY (name_selector_entry), name_selector_entry->priv->entry_completion);
+	gtk_entry_set_completion (
+		GTK_ENTRY (name_selector_entry),
+		name_selector_entry->priv->entry_completion);
 
 	renderer = gtk_cell_renderer_pixbuf_new ();
-	gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (name_selector_entry->priv->entry_completion), renderer, FALSE);
-	gtk_cell_layout_set_cell_data_func (GTK_CELL_LAYOUT (name_selector_entry->priv->entry_completion),
+	gtk_cell_layout_pack_start (
+		GTK_CELL_LAYOUT (name_selector_entry->priv->entry_completion),
+		renderer, FALSE);
+	gtk_cell_layout_set_cell_data_func (
+		GTK_CELL_LAYOUT (name_selector_entry->priv->entry_completion),
 		GTK_CELL_RENDERER (renderer),
 		(GtkCellLayoutDataFunc) contact_layout_pixbuffer,
 		name_selector_entry, NULL);
 
 	/* Completion list name renderer */
 	renderer = gtk_cell_renderer_text_new ();
-	gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (name_selector_entry->priv->entry_completion),
-			      renderer, TRUE);
-	gtk_cell_layout_set_cell_data_func (GTK_CELL_LAYOUT (name_selector_entry->priv->entry_completion),
-				      GTK_CELL_RENDERER (renderer),
-				      (GtkCellLayoutDataFunc) contact_layout_formatter,
-				      name_selector_entry, NULL);
+	gtk_cell_layout_pack_start (
+		GTK_CELL_LAYOUT (name_selector_entry->priv->entry_completion),
+		renderer, TRUE);
+	gtk_cell_layout_set_cell_data_func (
+		GTK_CELL_LAYOUT (name_selector_entry->priv->entry_completion),
+		GTK_CELL_RENDERER (renderer),
+		(GtkCellLayoutDataFunc) contact_layout_formatter,
+		name_selector_entry, NULL);
 
 	/* Destination store */
 
@@ -3095,7 +3124,7 @@ e_name_selector_entry_init (ENameSelectorEntry *name_selector_entry)
 ENameSelectorEntry *
 e_name_selector_entry_new (void)
 {
-	  return g_object_new (e_name_selector_entry_get_type (), NULL);
+	return g_object_new (E_TYPE_NAME_SELECTOR_ENTRY, NULL);
 }
 
 /**
diff --git a/libedataserverui/e-name-selector-list.c b/libedataserverui/e-name-selector-list.c
index cf1c488..ce38e5f 100644
--- a/libedataserverui/e-name-selector-list.c
+++ b/libedataserverui/e-name-selector-list.c
@@ -701,5 +701,5 @@ e_name_selector_list_init (ENameSelectorList *list)
 ENameSelectorList *
 e_name_selector_list_new (void)
 {
-	return g_object_new (e_name_selector_list_get_type (), NULL);
+	return g_object_new (E_TYPE_NAME_SELECTOR_LIST, NULL);
 }
diff --git a/libedataserverui/e-name-selector.c b/libedataserverui/e-name-selector.c
index 7f1362d..9292bfe 100644
--- a/libedataserverui/e-name-selector.c
+++ b/libedataserverui/e-name-selector.c
@@ -258,7 +258,9 @@ name_selector_dispose (GObject *object)
 
 		section = &g_array_index (priv->sections, Section, ii);
 		if (section->entry)
-			g_object_weak_unref (G_OBJECT (section->entry), reset_pointer_cb, object);
+			g_object_weak_unref (
+				G_OBJECT (section->entry),
+				reset_pointer_cb, object);
 		g_free (section->name);
 	}
 
@@ -556,7 +558,8 @@ e_name_selector_peek_section_list (ENameSelector *name_selector,
 		gchar         *text;
 		gint           i;
 
-		section->entry = (ENameSelectorEntry *) e_name_selector_list_new ();
+		section->entry = (ENameSelectorEntry *)
+			e_name_selector_list_new ();
 		g_object_weak_ref (G_OBJECT (section->entry), reset_pointer_cb, name_selector);
 		if (pango_parse_markup (name, -1, '_', NULL,
 					&text, NULL, NULL))  {
diff --git a/libedataserverui/e-source-combo-box.c b/libedataserverui/e-source-combo-box.c
index 996aa37..d65dc50 100644
--- a/libedataserverui/e-source-combo-box.c
+++ b/libedataserverui/e-source-combo-box.c
@@ -29,8 +29,6 @@
 	(G_TYPE_INSTANCE_GET_PRIVATE \
 	((obj), E_TYPE_SOURCE_COMBO_BOX, ESourceComboBoxPrivate))
 
-G_DEFINE_TYPE (ESourceComboBox, e_source_combo_box, GTK_TYPE_COMBO_BOX)
-
 struct _ESourceComboBoxPrivate {
 	ESourceList *source_list;
 	GHashTable *uid_index;
@@ -51,7 +49,7 @@ enum {
 	NUM_COLUMNS
 };
 
-static gpointer parent_class = NULL;
+G_DEFINE_TYPE (ESourceComboBox, e_source_combo_box, GTK_TYPE_COMBO_BOX)
 
 static gint
 compare_source_names (ESource *source_a,
@@ -191,7 +189,7 @@ e_source_combo_box_constructor (GType type,
 	GObject *object;
 
 	/* Chain up to parent's "constructor" method. */
-	object = G_OBJECT_CLASS (parent_class)->constructor (
+	object = G_OBJECT_CLASS (e_source_combo_box_parent_class)->constructor (
 		type, n_construct_properties, construct_properties);
 
 	store = gtk_list_store_new (
@@ -277,7 +275,7 @@ e_source_combo_box_dispose (GObject *object)
 	g_hash_table_remove_all (priv->uid_index);
 
 	/* Chain up to parent's "dispose" method. */
-	G_OBJECT_CLASS (parent_class)->dispose (object);
+	G_OBJECT_CLASS (e_source_combo_box_parent_class)->dispose (object);
 }
 
 static void
@@ -290,7 +288,7 @@ e_source_combo_box_finalize (GObject *object)
 	g_hash_table_destroy (priv->uid_index);
 
 	/* Chain up to parent's "finalize" method. */
-	G_OBJECT_CLASS (parent_class)->finalize (object);
+	G_OBJECT_CLASS (e_source_combo_box_parent_class)->finalize (object);
 }
 
 static void
@@ -298,8 +296,6 @@ e_source_combo_box_class_init (ESourceComboBoxClass *class)
 {
 	GObjectClass *object_class = G_OBJECT_CLASS (class);
 
-	parent_class = g_type_class_peek_parent (class);
-
 	g_type_class_add_private (class, sizeof (ESourceComboBoxPrivate));
 
 	object_class->constructor = e_source_combo_box_constructor;
diff --git a/libedataserverui/e-source-selector-dialog.c b/libedataserverui/e-source-selector-dialog.c
index 34c47ff..604e1e1 100644
--- a/libedataserverui/e-source-selector-dialog.c
+++ b/libedataserverui/e-source-selector-dialog.c
@@ -100,7 +100,7 @@ source_selector_dialog_dispose (GObject *object)
 		priv->source_list = NULL;
 	}
 
-	if (priv->selected_source) {
+	if (priv->selected_source != NULL) {
 		g_object_unref (priv->selected_source);
 		priv->selected_source = NULL;
 	}
@@ -110,23 +110,13 @@ source_selector_dialog_dispose (GObject *object)
 }
 
 static void
-e_source_selector_dialog_class_init (ESourceSelectorDialogClass *class)
-{
-	GObjectClass *object_class;
-
-	g_type_class_add_private (class, sizeof (ESourceSelectorDialogPrivate));
-
-	object_class = G_OBJECT_CLASS (class);
-	object_class->dispose = source_selector_dialog_dispose;
-}
-
-static void
-e_source_selector_dialog_init (ESourceSelectorDialog *dialog)
+source_selector_dialog_constructed (GObject *object)
 {
+	ESourceSelectorDialog *dialog;
 	GtkWidget *action_area;
 	GtkWidget *content_area;
 
-	dialog->priv = E_SOURCE_SELECTOR_DIALOG_GET_PRIVATE (dialog);
+	dialog = E_SOURCE_SELECTOR_DIALOG (object);
 
 	action_area = gtk_dialog_get_action_area (GTK_DIALOG (dialog));
 	content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
@@ -144,6 +134,24 @@ e_source_selector_dialog_init (ESourceSelectorDialog *dialog)
 	gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), GTK_RESPONSE_OK, FALSE);
 }
 
+static void
+e_source_selector_dialog_class_init (ESourceSelectorDialogClass *class)
+{
+	GObjectClass *object_class;
+
+	g_type_class_add_private (class, sizeof (ESourceSelectorDialogPrivate));
+
+	object_class = G_OBJECT_CLASS (class);
+	object_class->dispose = source_selector_dialog_dispose;
+	object_class->constructed = source_selector_dialog_constructed;
+}
+
+static void
+e_source_selector_dialog_init (ESourceSelectorDialog *dialog)
+{
+	dialog->priv = E_SOURCE_SELECTOR_DIALOG_GET_PRIVATE (dialog);
+}
+
 /* Public API */
 
 static GtkWidget *
diff --git a/libedataserverui/e-source-selector-dialog.h b/libedataserverui/e-source-selector-dialog.h
index 66b8cf1..c207ab2 100644
--- a/libedataserverui/e-source-selector-dialog.h
+++ b/libedataserverui/e-source-selector-dialog.h
@@ -26,6 +26,7 @@
 
 #include <gtk/gtk.h>
 #include <libedataserver/e-source-list.h>
+#include <libedataserverui/e-source-selector.h>
 
 /* Standard GObject macros */
 #define E_TYPE_SOURCE_SELECTOR_DIALOG \
@@ -64,6 +65,9 @@ struct _ESourceSelectorDialogClass {
 GType		e_source_selector_dialog_get_type (void);
 GtkWidget *	e_source_selector_dialog_new	(GtkWindow *parent,
 						 ESourceList *source_list);
+ESourceSelector *
+		e_source_selector_dialog_get_selector
+						(ESourceSelectorDialog *dialog);
 gboolean	e_source_selector_dialog_select_default_source
 						(ESourceSelectorDialog *dialog);
 ESource *	e_source_selector_dialog_peek_primary_selection
diff --git a/libedataserverui/e-source-selector.c b/libedataserverui/e-source-selector.c
index b827f2a..2d6a5af 100644
--- a/libedataserverui/e-source-selector.c
+++ b/libedataserverui/e-source-selector.c
@@ -1257,7 +1257,8 @@ e_source_selector_class_init (ESourceSelectorClass *class)
 			NULL,
 			NULL,
 			E_TYPE_SOURCE,
-			G_PARAM_READWRITE));
+			G_PARAM_READWRITE |
+			G_PARAM_STATIC_STRINGS));
 
 	g_object_class_install_property (
 		object_class,
@@ -1268,7 +1269,8 @@ e_source_selector_class_init (ESourceSelectorClass *class)
 			NULL,
 			E_TYPE_SOURCE_LIST,
 			G_PARAM_READWRITE |
-			G_PARAM_CONSTRUCT_ONLY));
+			G_PARAM_CONSTRUCT_ONLY |
+			G_PARAM_STATIC_STRINGS));
 
 	signals[SELECTION_CHANGED] = g_signal_new (
 		"selection-changed",



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