Reduce diff noise with account-mgmt branch.
authorMatthew Barnes <mbarnes@redhat.com>
Thu, 26 May 2011 15:21:37 +0000 (11:21 -0400)
committerMatthew Barnes <mbarnes@redhat.com>
Thu, 26 May 2011 15:35:09 +0000 (11:35 -0400)
Mostly silly code cleanup type stuff, so I can see the important changes
more easily.

36 files changed:
addressbook/backends/ldap/e-book-backend-ldap-factory.c
addressbook/backends/vcf/e-book-backend-vcf-factory.c
addressbook/backends/webdav/e-book-backend-webdav.c
addressbook/libebook/e-book.c
addressbook/libebook/e-destination.c
addressbook/libedata-book/e-book-backend-db-cache.c
addressbook/libedata-book/e-book-backend.c
addressbook/libedata-book/e-data-book-factory.c
calendar/backends/caldav/e-cal-backend-caldav.c
calendar/backends/contacts/e-cal-backend-contacts-factory.c
calendar/backends/contacts/e-cal-backend-contacts.c
calendar/backends/file/e-cal-backend-file-factory.c
calendar/backends/file/e-cal-backend-file.c
calendar/backends/http/e-cal-backend-http-factory.c
calendar/backends/http/e-cal-backend-http.c
calendar/backends/weather/e-cal-backend-weather-factory.c
calendar/backends/weather/e-cal-backend-weather.c
calendar/backends/weather/e-weather-source-ccf.c
calendar/backends/weather/e-weather-source-ccf.h
calendar/backends/weather/e-weather-source.c
calendar/backends/weather/e-weather-source.h
calendar/libecal/e-cal.c
calendar/libecal/e-cal.h
calendar/libedata-cal/e-cal-backend.c
calendar/libedata-cal/e-data-cal-factory.c
configure.ac
libedataserverui/e-book-auth-util.c
libedataserverui/e-name-selector-dialog.c
libedataserverui/e-name-selector-entry.c
libedataserverui/e-name-selector.h
libedataserverui/e-source-combo-box.c
libedataserverui/e-source-combo-box.h
libedataserverui/e-source-selector-dialog.c
libedataserverui/e-source-selector-dialog.h
libedataserverui/e-source-selector.c
libedataserverui/e-source-selector.h

index 73da037..ae9e014 100644 (file)
@@ -34,13 +34,13 @@ E_BOOK_BACKEND_FACTORY_SIMPLE (ldap, LDAP, e_book_backend_ldap_new)
 static GType ldap_type;
 
 void
-eds_module_initialize (GTypeModule *module)
+eds_module_initialize (GTypeModule *type_module)
 {
-       ldap_type = _ldap_factory_get_type (module);
+       ldap_type = _ldap_factory_get_type (type_module);
 }
 
 void
-eds_module_shutdown   (void)
+eds_module_shutdown (void)
 {
 }
 
index cc3e716..e7aeffd 100644 (file)
@@ -34,13 +34,13 @@ E_BOOK_BACKEND_FACTORY_SIMPLE (vcf, VCF, e_book_backend_vcf_new)
 static GType  vcf_type;
 
 void
-eds_module_initialize (GTypeModule *module)
+eds_module_initialize (GTypeModule *type_module)
 {
-       vcf_type = _vcf_factory_get_type (module);
+       vcf_type = _vcf_factory_get_type (type_module);
 }
 
 void
-eds_module_shutdown   (void)
+eds_module_shutdown (void)
 {
 }
 
index 53033a8..c782ae3 100644 (file)
@@ -189,7 +189,7 @@ download_contact (EBookBackendWebdav *webdav, const gchar *uri)
 static guint
 upload_contact (EBookBackendWebdav *webdav, EContact *contact, gchar **reason)
 {
-       ESource     *source = e_book_backend_get_source (E_BOOK_BACKEND (webdav));
+       ESource     *source;
        SoupMessage *message;
        gchar       *uri;
        gchar       *etag;
@@ -199,6 +199,8 @@ upload_contact (EBookBackendWebdav *webdav, EContact *contact, gchar **reason)
        const gchar  *property;
        gboolean     avoid_ifmatch;
 
+       source = e_book_backend_get_source (E_BOOK_BACKEND (webdav));
+
        uri = e_contact_get (contact, E_CONTACT_UID);
        if (uri == NULL) {
                g_warning("can't upload contact without UID");
@@ -1159,7 +1161,7 @@ e_book_backend_webdav_open (EBookBackend *backend, EDataBook *book, guint opid,
 {
        EBookBackendWebdav        *webdav = E_BOOK_BACKEND_WEBDAV (backend);
        EBookBackendWebdavPrivate *priv   = webdav->priv;
-       ESource                   *source = e_book_backend_get_source (backend);
+       ESource                   *source;
        gchar                     *uri;
        const gchar               *cache_dir;
        const gchar               *offline;
@@ -1172,6 +1174,7 @@ e_book_backend_webdav_open (EBookBackend *backend, EDataBook *book, guint opid,
        /* will try fetch ctag for the first time, if it fails then sets this to FALSE */
        priv->supports_getctag = TRUE;
 
+       source = e_book_backend_get_source (backend);
        cache_dir = e_book_backend_get_cache_dir (backend);
 
        uri = e_source_get_uri (source);
index 009e406..a2a06c8 100644 (file)
@@ -40,6 +40,7 @@
 #include <string.h>
 #include <glib-object.h>
 #include <glib/gi18n-lib.h>
+#include <gconf/gconf-client.h>
 #include <libedataserver/e-data-server-util.h>
 #include "e-book.h"
 #include "e-error.h"
@@ -3210,10 +3211,10 @@ e_book_set_default_addressbook (EBook *book, GError **error)
 
 /**
  * e_book_set_default_source:
- * @source: An #ESource pointer
- * @error: A #GError pointer
+ * @source: an #ESource
+ * @error: return location for a #GError, or %NULL
  *
- * sets @source as the "default" addressbook.  This is the source that
+ * Sets @source as the default address book.  This is the source that
  * will be loaded in the e_book_get_default_addressbook call.
  *
  * Returns: %TRUE if the setting was stored in libebook's ESourceList, otherwise %FALSE.
@@ -3221,7 +3222,8 @@ e_book_set_default_addressbook (EBook *book, GError **error)
  * Deprecated: 3.2: Use e_book_client_set_default_source() instead.
  */
 gboolean
-e_book_set_default_source (ESource *source, GError **error)
+e_book_set_default_source (ESource *source,
+                           GError **error)
 {
        ESourceList *sources;
        const gchar *uid;
@@ -3303,10 +3305,10 @@ e_book_get_addressbooks (ESourceList **addressbook_sources, GError **error)
 
 /**
  * e_book_new:
- * @source: An #ESource pointer
- * @error: A #GError pointer
+ * @source: an #ESource
+ * @error: return location for a #GError, or %NULL
  *
- * Creates a new #EBook corresponding to the given source.  There are
+ * Creates a new #EBook corresponding to the given @source.  There are
  * only two operations that are valid on this book at this point:
  * e_book_open(), and e_book_remove().
  *
@@ -3315,11 +3317,13 @@ e_book_get_addressbooks (ESourceList **addressbook_sources, GError **error)
  * Deprecated: 3.2: Use e_book_client_new() instead.
  */
 EBook *
-e_book_new (ESource *source, GError **error)
+e_book_new (ESource *source,
+            GError **error)
 {
        GError *err = NULL;
        EBook *book;
-       gchar *path = NULL, *xml, *gdbus_xml = NULL;
+       gchar *path = NULL;
+       gchar *xml, *gdbus_xml = NULL;
        GDBusConnection *connection;
 
        g_return_val_if_fail (E_IS_SOURCE (source), NULL);
@@ -3533,9 +3537,8 @@ check_system (ESource *source, gpointer data)
  * e_book_new_system_addressbook:
  * @error: A #GError pointer
  *
- * Creates a new #EBook corresponding to the user's system
- * addressbook.  See the documentation for e_book_new for further
- * information.
+ * Creates a new #EBook corresponding to the user's system address book.
+ * See the documentation for e_book_new() for further information.
  *
  * Returns: a new but unopened #EBook.
  *
@@ -3588,9 +3591,8 @@ e_book_new_system_addressbook (GError **error)
  * e_book_new_default_addressbook:
  * @error: return location for a #GError, or %NULL
  *
- * Creates a new #EBook corresponding to the user's default
- * address book.  See the documentation for e_book_new() for
- * further information.
+ * Creates a new #EBook corresponding to the user's default address book.
+ * See the documentation for e_book_new() for further information.
  *
  * Returns: a new but unopened #EBook
  *
index 8d9fe24..b219943 100644 (file)
@@ -456,15 +456,18 @@ void
 e_destination_set_book (EDestination *dest, EBook *book)
 {
        ESource *source;
+       const gchar *uid;
 
        g_return_if_fail (dest && E_IS_DESTINATION (dest));
        g_return_if_fail (book && E_IS_BOOK (book));
 
        source = e_book_get_source (book);
+       uid = e_source_peek_uid (source);
+       g_return_if_fail (uid != NULL);
 
-       if (!dest->priv->source_uid || strcmp (e_source_peek_uid (source), dest->priv->source_uid)) {
+       if (!dest->priv->source_uid || strcmp (uid, dest->priv->source_uid)) {
                e_destination_clear (dest);
-               dest->priv->source_uid = g_strdup (e_source_peek_uid (source));
+               dest->priv->source_uid = g_strdup (uid);
 
                g_signal_emit (dest, signals[CHANGED], 0);
        }
index b846696..d060a4e 100644 (file)
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  */
 
-#ifdef HAVE_CONFIG_H
 #include <config.h>
-#endif
-
+#include <stdlib.h>
 #include <string.h>
+
 #include <libedataserver/e-data-server-util.h>
 #include "e-book-backend-db-cache.h"
 #include "e-book-backend.h"
index 204e53a..72cfd01 100644 (file)
@@ -56,9 +56,7 @@ book_backend_set_default_cache_dir (EBookBackend *backend)
        gchar *filename;
 
        user_cache_dir = e_get_user_cache_dir ();
-
        source = e_book_backend_get_source (backend);
-       g_return_if_fail (source != NULL);
 
        /* Mangle the URI to not contain invalid characters. */
        mangled_uri = g_strdelimit (e_source_get_uri (source), ":/", '_');
index e74a108..a70e5bf 100644 (file)
@@ -300,13 +300,17 @@ last_client_gone_cb (EBookBackend *backend, EDataBookFactory *factory)
 }
 
 static gboolean
-impl_BookFactory_getBook (EGdbusBookFactory *object, GDBusMethodInvocation *invocation, const gchar *in_source, EDataBookFactory *factory)
+impl_BookFactory_getBook (EGdbusBookFactory *object,
+                          GDBusMethodInvocation *invocation,
+                          const gchar *in_source,
+                          EDataBookFactory *factory)
 {
        EDataBook *book;
        EBookBackend *backend;
        EDataBookFactoryPrivate *priv = factory->priv;
        ESource *source;
-       gchar *uri, *path;
+       gchar *path;
+       gchar *uri;
        const gchar *sender;
        GList *list;
        GError *error = NULL;
@@ -358,12 +362,14 @@ impl_BookFactory_getBook (EGdbusBookFactory *object, GDBusMethodInvocation *invo
                        backend = e_book_backend_factory_new_backend (backend_factory);
 
                if (backend != NULL) {
-                       gchar *uri_key = g_strdup (uri);
-
                        g_hash_table_insert (
-                               priv->backends, uri_key, backend);
-                       g_object_weak_ref (G_OBJECT (backend), (GWeakNotify) backend_gone_cb, factory);
-                       g_signal_connect (backend, "last-client-gone", G_CALLBACK (last_client_gone_cb), factory);
+                               priv->backends, g_strdup (uri), backend);
+                       g_object_weak_ref (
+                               G_OBJECT (backend), (GWeakNotify)
+                               backend_gone_cb, factory);
+                       g_signal_connect (
+                               backend, "last-client-gone",
+                               G_CALLBACK (last_client_gone_cb), factory);
                        e_book_backend_set_online (backend, priv->is_online);
                }
        }
@@ -375,7 +381,10 @@ impl_BookFactory_getBook (EGdbusBookFactory *object, GDBusMethodInvocation *invo
                g_mutex_unlock (priv->books_lock);
                g_mutex_unlock (priv->backends_lock);
 
-               error = g_error_new (E_DATA_BOOK_ERROR, E_DATA_BOOK_STATUS_NO_SUCH_BOOK, _("Invalid source"));
+               error = g_error_new (
+                       E_DATA_BOOK_ERROR,
+                       E_DATA_BOOK_STATUS_NO_SUCH_BOOK,
+                       _("Invalid source"));
                g_dbus_method_invocation_return_gerror (invocation, error);
                g_error_free (error);
 
@@ -665,7 +674,8 @@ main (gint argc, gchar **argv)
                eol, "changed",
                G_CALLBACK (offline_state_changed_cb), factory);
 
-       owner_id = g_bus_own_name (G_BUS_TYPE_SESSION,
+       owner_id = g_bus_own_name (
+               G_BUS_TYPE_SESSION,
                ADDRESS_BOOK_DBUS_SERVICE_NAME,
                G_BUS_NAME_OWNER_FLAGS_NONE,
                on_bus_acquired,
index b99491e..8ccffa2 100644 (file)
@@ -114,7 +114,7 @@ struct _ECalBackendCalDAVPrivate {
 
        /* Authentication info */
        ECredentials *credentials;
-       gboolean need_auth;
+       gboolean auth_required;
 
        /* object cleanup */
        gboolean disposed;
@@ -531,7 +531,7 @@ status_code_to_result (SoupMessage *message, ECalBackendCalDAVPrivate  *priv, GE
                break;
 
        case 401:
-               if (priv && priv->need_auth)
+               if (priv && priv->auth_required)
                        g_propagate_error (perror, EDC_ERROR (AuthenticationFailed));
                else
                        g_propagate_error (perror, EDC_ERROR (AuthenticationRequired));
@@ -2289,7 +2289,7 @@ initialize_backend (ECalBackendCalDAV *cbdav, GError **perror)
        }
 
        os_val = e_source_get_property (source, "auth");
-       priv->need_auth = os_val != NULL;
+       priv->auth_required = os_val != NULL;
 
        os_val = e_source_get_property(source, "ssl");
        uri = e_cal_backend_get_uri (backend);
index 6c75b53..7929c74 100644 (file)
 #include "e-cal-backend-contacts-factory.h"
 #include "e-cal-backend-contacts.h"
 
-typedef struct {
-       ECalBackendFactory            parent_object;
-} ECalBackendContactsFactory;
+typedef ECalBackendFactory ECalBackendContactsEventsFactory;
+typedef ECalBackendFactoryClass ECalBackendContactsEventsFactoryClass;
 
-typedef struct {
-       ECalBackendFactoryClass parent_class;
-} ECalBackendContactsFactoryClass;
+/* Forward Declarations */
+GType e_cal_backend_contacts_events_factory_get_type (void);
 
-static void
-e_cal_backend_contacts_factory_instance_init (ECalBackendContactsFactory *factory)
-{
-}
+G_DEFINE_DYNAMIC_TYPE (
+       ECalBackendContactsEventsFactory,
+       e_cal_backend_contacts_events_factory,
+       E_TYPE_CAL_BACKEND_FACTORY)
 
 static const gchar *
 _get_protocol (ECalBackendFactory *factory)
@@ -35,13 +33,14 @@ _get_protocol (ECalBackendFactory *factory)
        return "contacts";
 }
 
-static ECalBackend*
-_events_new_backend (ECalBackendFactory *factory, ESource *source)
+static ECalBackend *
+_events_new_backend (ECalBackendFactory *factory,
+                     ESource *source)
 {
-       return g_object_new (e_cal_backend_contacts_get_type (),
-                            "source", source,
-                            "kind", ICAL_VEVENT_COMPONENT,
-                            NULL);
+       return g_object_new (
+               e_cal_backend_contacts_get_type (),
+               "kind", ICAL_VEVENT_COMPONENT,
+               "source", source, NULL);
 }
 
 static icalcomponent_kind
@@ -51,56 +50,41 @@ _events_get_kind (ECalBackendFactory *factory)
 }
 
 static void
-events_backend_factory_class_init (ECalBackendContactsFactoryClass *klass)
+e_cal_backend_contacts_events_factory_class_init (ECalBackendFactoryClass *class)
 {
-       E_CAL_BACKEND_FACTORY_CLASS (klass)->get_protocol = _get_protocol;
-       E_CAL_BACKEND_FACTORY_CLASS (klass)->get_kind     = _events_get_kind;
-       E_CAL_BACKEND_FACTORY_CLASS (klass)->new_backend  = _events_new_backend;
+       class->get_protocol = _get_protocol;
+       class->get_kind     = _events_get_kind;
+       class->new_backend  = _events_new_backend;
 }
 
-static GType
-events_backend_factory_get_type (GTypeModule *module)
+static void
+e_cal_backend_contacts_events_factory_class_finalize (ECalBackendFactoryClass *class)
 {
-       GType type;
-
-       GTypeInfo info = {
-               sizeof (ECalBackendContactsFactoryClass),
-               NULL, /* base_class_init */
-               NULL, /* base_class_finalize */
-               (GClassInitFunc)  events_backend_factory_class_init,
-               NULL, /* class_finalize */
-               NULL, /* class_data */
-               sizeof (ECalBackend),
-               0,    /* n_preallocs */
-               (GInstanceInitFunc) e_cal_backend_contacts_factory_instance_init
-       };
-
-       type = g_type_module_register_type (module,
-                                           E_TYPE_CAL_BACKEND_FACTORY,
-                                           "ECalBackendContactsEventsFactory",
-                                           &info, 0);
-
-       return type;
 }
 
-\f
-
-static GType contacts_types[1];
+static void
+e_cal_backend_contacts_events_factory_init (ECalBackendFactory *factory)
+{
+}
 
 void
-eds_module_initialize (GTypeModule *module)
+eds_module_initialize (GTypeModule *type_module)
 {
-       contacts_types[0] = events_backend_factory_get_type (module);
+       e_cal_backend_contacts_events_factory_register_type (type_module);
 }
 
 void
-eds_module_shutdown   (void)
+eds_module_shutdown (void)
 {
 }
 
 void
 eds_module_list_types (const GType **types, gint *num_types)
 {
+       static GType contacts_types[1];
+
+       contacts_types[0] = e_cal_backend_contacts_events_factory_get_type ();
+
        *types = contacts_types;
-       *num_types = 1;
+       *num_types = G_N_ELEMENTS (contacts_types);
 }
index 89f7bfb..1aff087 100644 (file)
 
 #include <glib/gi18n-lib.h>
 #include <gconf/gconf-client.h>
-#include "libedataserver/e-xml-hash-utils.h"
-#include "libedataserver/e-flag.h"
+#include <libedataserver/e-xml-hash-utils.h>
+#include <libedataserver/e-source-list.h>
+#include <libedataserver/e-flag.h>
 #include <libecal/e-cal-recur.h>
 #include <libecal/e-cal-util.h>
 #include <libedata-cal/e-cal-backend-util.h>
 #include <libedata-cal/e-cal-backend-sexp.h>
-
 #include <libebook/e-book.h>
 
-#include "libedataserver/e-source-list.h"
 
 #define EDC_ERROR(_code) e_data_cal_create_error (_code, NULL)
 
@@ -60,11 +59,11 @@ typedef enum
 struct _ECalBackendContactsPrivate {
         ESourceList  *addressbook_sources;
 
-        GHashTable   *addressbooks;       /* UID -> BookRecord */
-        gboolean      addressbook_loaded;
+       GHashTable   *addressbooks;       /* UID -> BookRecord */
+       gboolean      addressbook_loaded;
 
-        EBookView    *book_view;
-        GHashTable   *tracked_contacts;   /* UID -> ContactRecord */
+       EBookView    *book_view;
+       GHashTable   *tracked_contacts;   /* UID -> ContactRecord */
 
        GHashTable *zones;
 
@@ -83,15 +82,15 @@ struct _ECalBackendContactsPrivate {
 
 typedef struct _BookRecord {
        ECalBackendContacts *cbc;
-        EBook     *book;
-        EBookView *book_view;
+       EBook     *book;
+       EBookView *book_view;
 } BookRecord;
 
 typedef struct _ContactRecord {
-        ECalBackendContacts *cbc;
-       EBook               *book; /* where it comes from */
-        EContact            *contact;
-        ECalComponent       *comp_birthday, *comp_anniversary;
+       ECalBackendContacts *cbc;
+       EBook          *book; /* where it comes from */
+       EContact            *contact;
+       ECalComponent       *comp_birthday, *comp_anniversary;
 } ContactRecord;
 
 #define d(x)
@@ -121,19 +120,20 @@ book_record_new (ECalBackendContacts *cbc, ESource *source)
 
        book = e_book_new (source, &error);
        if (!book || !e_book_open (book, TRUE, &error) || error) {
-               g_warning ("%s: Failed to open book '%s': %s", G_STRFUNC, e_source_peek_name (source), error ? error->message : "Unknown error");
                if (book)
                        g_object_unref (book);
-               if (error)
+               if (error) {
+                       g_warning ("%s: Failed to open book: %s", G_STRFUNC, error->message);
                        g_error_free (error);
+               }
                return NULL;
        }
 
-        /* Create book view */
+       /* Create book view */
        fields = g_list_append (fields, (gchar *) e_contact_field_name (E_CONTACT_FILE_AS));
        fields = g_list_append (fields, (gchar *) e_contact_field_name (E_CONTACT_BIRTH_DATE));
        fields = g_list_append (fields, (gchar *) e_contact_field_name (E_CONTACT_ANNIVERSARY));
-        query = e_book_query_any_field_contains ("");
+       query = e_book_query_any_field_contains ("");
 
        if (!e_book_get_book_view (book, query, fields, -1, &book_view, &error)) {
                g_warning ("%s: Failed to get book view on '%s': %s", G_STRFUNC, e_source_peek_name (source), error ? error->message : "Unknown error");
@@ -150,9 +150,9 @@ book_record_new (ECalBackendContacts *cbc, ESource *source)
        e_book_query_unref (query);
        g_list_free (fields);
 
-        g_signal_connect (book_view, "contacts_added", G_CALLBACK (contacts_added_cb), cbc);
-        g_signal_connect (book_view, "contacts_removed", G_CALLBACK (contacts_removed_cb), cbc);
-        g_signal_connect (book_view, "contacts_changed", G_CALLBACK (contacts_changed_cb), cbc);
+       g_signal_connect (book_view, "contacts_added", G_CALLBACK (contacts_added_cb), cbc);
+       g_signal_connect (book_view, "contacts_removed", G_CALLBACK (contacts_removed_cb), cbc);
+       g_signal_connect (book_view, "contacts_changed", G_CALLBACK (contacts_changed_cb), cbc);
 
        e_book_view_start (book_view);
 
@@ -433,7 +433,7 @@ contacts_changed_cb (EBookView *book_view, const GList *contacts, gpointer user_
                const gchar *uid = e_contact_get_const (contact, E_CONTACT_UID);
                EContactDate *birthday, *anniversary;
 
-                /* Because this is a change of contact, then always remove old tracked data
+               /* Because this is a change of contact, then always remove old tracked data
                   and if possible, add with (possibly) new values.
                */
                g_hash_table_remove (cbc->priv->tracked_contacts, (gchar *) uid);
@@ -458,7 +458,7 @@ contacts_added_cb (EBookView *book_view, const GList *contacts, gpointer user_da
        EBook *book = e_book_view_get_book (book_view);
        const GList *i;
 
-        /* See if any new contacts have BIRTHDAY or ANNIVERSARY fields */
+       /* See if any new contacts have BIRTHDAY or ANNIVERSARY fields */
        for (i = contacts; i; i = i->next)
        {
                EContact *contact = E_CONTACT (i->data);
@@ -485,7 +485,7 @@ contacts_removed_cb (EBookView *book_view, const GList *contact_ids, gpointer us
        ECalBackendContacts *cbc = E_CAL_BACKEND_CONTACTS (user_data);
        const GList *i;
 
-        /* Stop tracking these */
+       /* Stop tracking these */
        for (i = contact_ids; i; i = i->next)
                g_hash_table_remove (cbc->priv->tracked_contacts, i->data);
 }
@@ -683,7 +683,7 @@ create_component (ECalBackendContacts *cbc, const gchar *uid, EContactDate *cdat
 
        ical_comp = icalcomponent_new (ICAL_VEVENT_COMPONENT);
 
-        /* Create the event object */
+       /* Create the event object */
        cal_comp = e_cal_component_new ();
        e_cal_component_set_icalcomponent (cal_comp, ical_comp);
 
@@ -691,7 +691,7 @@ create_component (ECalBackendContacts *cbc, const gchar *uid, EContactDate *cdat
        d(g_message ("Creating UID: %s", uid));
        e_cal_component_set_uid (cal_comp, uid);
 
-        /* Set all-day event's date from contact data */
+       /* Set all-day event's date from contact data */
        itt = cdate_to_icaltime (cdate);
        dt.value = &itt;
        dt.tzid = NULL;
@@ -704,7 +704,7 @@ create_component (ECalBackendContacts *cbc, const gchar *uid, EContactDate *cdat
        /* We have to add 1 day to DTEND, as it is not inclusive. */
        e_cal_component_set_dtend (cal_comp, &dt);
 
-        /* Create yearly recurrence */
+       /* Create yearly recurrence */
        icalrecurrencetype_clear (&r);
        r.freq = ICAL_YEARLY_RECURRENCE;
        r.interval = 1;
@@ -712,7 +712,7 @@ create_component (ECalBackendContacts *cbc, const gchar *uid, EContactDate *cdat
        recur_list.next = NULL;
        e_cal_component_set_rrule_list (cal_comp, &recur_list);
 
-        /* Create summary */
+       /* Create summary */
        comp_summary.value = summary;
        comp_summary.altrep = NULL;
        e_cal_component_set_summary (cal_comp, &comp_summary);
@@ -731,7 +731,7 @@ create_component (ECalBackendContacts *cbc, const gchar *uid, EContactDate *cdat
        /* setup alarms if required */
        setup_alarm (cbc, cal_comp);
 
-        /* Don't forget to call commit()! */
+       /* Don't forget to call commit()! */
        e_cal_component_commit_sequence (cal_comp);
 
        return cal_comp;
@@ -750,7 +750,7 @@ create_birthday (ECalBackendContacts *cbc, EContact *contact)
        name = e_contact_get_const (contact, E_CONTACT_FILE_AS);
 
        uid = g_strdup_printf ("%s%s", (gchar *) e_contact_get_const (contact, E_CONTACT_UID), BIRTHDAY_UID_EXT);
-        summary = g_strdup_printf (_("Birthday: %s"), name);
+       summary = g_strdup_printf (_("Birthday: %s"), name);
 
        cal_comp = create_component (cbc, uid, cdate, summary);
 
@@ -774,7 +774,7 @@ create_anniversary (ECalBackendContacts *cbc, EContact *contact)
        name = e_contact_get_const (contact, E_CONTACT_FILE_AS);
 
        uid = g_strdup_printf ("%s%s", (gchar *) e_contact_get_const (contact, E_CONTACT_UID), ANNIVERSARY_UID_EXT);
-        summary = g_strdup_printf (_("Anniversary: %s"), name);
+       summary = g_strdup_printf (_("Anniversary: %s"), name);
 
        cal_comp = create_component (cbc, uid, cdate, summary);
 
@@ -853,14 +853,14 @@ e_cal_backend_contacts_get_object (ECalBackendSync *backend, EDataCal *cal, GCan
        }
 
        if (record->comp_birthday && g_str_has_suffix (uid, BIRTHDAY_UID_EXT)) {
-                *object = e_cal_component_get_as_string (record->comp_birthday);
+               *object = e_cal_component_get_as_string (record->comp_birthday);
 
                d(g_message ("Return birthday: %s", *object));
                return;
        }
 
        if (record->comp_anniversary && g_str_has_suffix (uid, ANNIVERSARY_UID_EXT)) {
-                *object = e_cal_component_get_as_string (record->comp_anniversary);
+               *object = e_cal_component_get_as_string (record->comp_anniversary);
 
                d(g_message ("Return anniversary: %s", *object));
                return;
index 00fbe4f..fb8578e 100644 (file)
 #include "e-cal-backend-file-journal.h"
 #include "e-cal-backend-file-todos.h"
 
-typedef struct {
-       ECalBackendFactory            parent_object;
-} ECalBackendFileFactory;
+typedef ECalBackendFactory ECalBackendFileEventsFactory;
+typedef ECalBackendFactoryClass ECalBackendFileEventsFactoryClass;
 
-typedef struct {
-       ECalBackendFactoryClass parent_class;
-} ECalBackendFileFactoryClass;
+typedef ECalBackendFactory ECalBackendFileJournalFactory;
+typedef ECalBackendFactoryClass ECalBackendFileJournalFactoryClass;
 
-static void
-e_cal_backend_file_factory_instance_init (ECalBackendFileFactory *factory)
-{
-}
+typedef ECalBackendFactory ECalBackendFileTodosFactory;
+typedef ECalBackendFactoryClass ECalBackendFileTodosFactoryClass;
+
+/* Forward Declarations */
+GType e_cal_backend_file_events_factory_get_type (void);
+GType e_cal_backend_file_journal_factory_get_type (void);
+GType e_cal_backend_file_todos_factory_get_type (void);
+
+G_DEFINE_DYNAMIC_TYPE (
+       ECalBackendFileEventsFactory,
+       e_cal_backend_file_events_factory,
+       E_TYPE_CAL_BACKEND_FACTORY)
+
+G_DEFINE_DYNAMIC_TYPE (
+       ECalBackendFileJournalFactory,
+       e_cal_backend_file_journal_factory,
+       E_TYPE_CAL_BACKEND_FACTORY)
+
+G_DEFINE_DYNAMIC_TYPE (
+       ECalBackendFileTodosFactory,
+       e_cal_backend_file_todos_factory,
+       E_TYPE_CAL_BACKEND_FACTORY)
 
 static const gchar *
 _get_protocol (ECalBackendFactory *factory)
@@ -37,28 +53,20 @@ _get_protocol (ECalBackendFactory *factory)
        return "local";
 }
 
-static ECalBackend*
-_todos_new_backend (ECalBackendFactory *factory, ESource *source)
-{
-       return g_object_new (e_cal_backend_file_todos_get_type (),
-                            "source", source,
-                            "kind", ICAL_VTODO_COMPONENT,
-                            NULL);
-}
-
 static icalcomponent_kind
-_todos_get_kind (ECalBackendFactory *factory)
+_events_get_kind (ECalBackendFactory *factory)
 {
-       return ICAL_VTODO_COMPONENT;
+       return ICAL_VEVENT_COMPONENT;
 }
 
-static ECalBackend*
-_journal_new_backend (ECalBackendFactory *factory, ESource *source)
+static ECalBackend *
+_events_new_backend (ECalBackendFactory *factory,
+                     ESource *source)
 {
-       return g_object_new (e_cal_backend_file_journal_get_type (),
-                            "source", source,
-                            "kind", ICAL_VJOURNAL_COMPONENT,
-                            NULL);
+       return g_object_new (
+               e_cal_backend_file_events_get_type (),
+               "kind", ICAL_VEVENT_COMPONENT,
+               "source", source, NULL);
 }
 
 static icalcomponent_kind
@@ -67,140 +75,108 @@ _journal_get_kind (ECalBackendFactory *factory)
        return ICAL_VJOURNAL_COMPONENT;
 }
 
-static ECalBackend*
-_events_new_backend (ECalBackendFactory *factory, ESource *source)
+static ECalBackend *
+_journal_new_backend (ECalBackendFactory *factory,
+                      ESource *source)
 {
-       return g_object_new (e_cal_backend_file_events_get_type (),
-                            "source", source,
-                            "kind", ICAL_VEVENT_COMPONENT,
-                            NULL);
+       return g_object_new (
+               e_cal_backend_file_journal_get_type (),
+               "kind", ICAL_VJOURNAL_COMPONENT,
+               "source", source, NULL);
 }
 
 static icalcomponent_kind
-_events_get_kind (ECalBackendFactory *factory)
+_todos_get_kind (ECalBackendFactory *factory)
 {
-       return ICAL_VEVENT_COMPONENT;
+       return ICAL_VTODO_COMPONENT;
 }
 
-static void
-todos_backend_factory_class_init (ECalBackendFileFactoryClass *klass)
+static ECalBackend *
+_todos_new_backend (ECalBackendFactory *factory,
+                    ESource *source)
 {
-       E_CAL_BACKEND_FACTORY_CLASS (klass)->get_protocol = _get_protocol;
-       E_CAL_BACKEND_FACTORY_CLASS (klass)->get_kind     = _todos_get_kind;
-       E_CAL_BACKEND_FACTORY_CLASS (klass)->new_backend  = _todos_new_backend;
+       return g_object_new (
+               e_cal_backend_file_todos_get_type (),
+               "kind", ICAL_VTODO_COMPONENT,
+               "source", source, NULL);
 }
 
 static void
-journal_backend_factory_class_init (ECalBackendFileFactoryClass *klass)
+e_cal_backend_file_events_factory_class_init (ECalBackendFactoryClass *class)
 {
-       E_CAL_BACKEND_FACTORY_CLASS (klass)->get_protocol = _get_protocol;
-       E_CAL_BACKEND_FACTORY_CLASS (klass)->get_kind     = _journal_get_kind;
-       E_CAL_BACKEND_FACTORY_CLASS (klass)->new_backend  = _journal_new_backend;
+       class->get_protocol = _get_protocol;
+       class->get_kind     = _events_get_kind;
+       class->new_backend  = _events_new_backend;
 }
 
 static void
-events_backend_factory_class_init (ECalBackendFileFactoryClass *klass)
+e_cal_backend_file_events_factory_class_finalize (ECalBackendFactoryClass *class)
 {
-       E_CAL_BACKEND_FACTORY_CLASS (klass)->get_protocol = _get_protocol;
-       E_CAL_BACKEND_FACTORY_CLASS (klass)->get_kind     = _events_get_kind;
-       E_CAL_BACKEND_FACTORY_CLASS (klass)->new_backend  = _events_new_backend;
 }
 
-static GType
-events_backend_factory_get_type (GTypeModule *module)
+static void
+e_cal_backend_file_events_factory_init (ECalBackendFactory *factory)
 {
-       GType type;
-
-       GTypeInfo info = {
-               sizeof (ECalBackendFileFactoryClass),
-               NULL, /* base_class_init */
-               NULL, /* base_class_finalize */
-               (GClassInitFunc)  events_backend_factory_class_init,
-               NULL, /* class_finalize */
-               NULL, /* class_data */
-               sizeof (ECalBackend),
-               0,    /* n_preallocs */
-               (GInstanceInitFunc) e_cal_backend_file_factory_instance_init
-       };
-
-       type = g_type_module_register_type (module,
-                                           E_TYPE_CAL_BACKEND_FACTORY,
-                                           "ECalBackendFileEventsFactory",
-                                           &info, 0);
-
-       return type;
 }
 
-static GType
-journal_backend_factory_get_type (GTypeModule *module)
+static void
+e_cal_backend_file_journal_factory_class_init (ECalBackendFactoryClass *class)
 {
-       GType type;
-
-       GTypeInfo info = {
-               sizeof (ECalBackendFileFactoryClass),
-               NULL, /* base_class_init */
-               NULL, /* base_class_finalize */
-               (GClassInitFunc)  journal_backend_factory_class_init,
-               NULL, /* class_finalize */
-               NULL, /* class_data */
-               sizeof (ECalBackend),
-               0,    /* n_preallocs */
-               (GInstanceInitFunc) e_cal_backend_file_factory_instance_init
-       };
-
-       type = g_type_module_register_type (module,
-                                           E_TYPE_CAL_BACKEND_FACTORY,
-                                           "ECalBackendFileJournalFactory",
-                                           &info, 0);
-
-       return type;
+       class->get_protocol = _get_protocol;
+       class->get_kind     = _journal_get_kind;
+       class->new_backend  = _journal_new_backend;
 }
 
-static GType
-todos_backend_factory_get_type (GTypeModule *module)
+static void
+e_cal_backend_file_journal_factory_class_finalize (ECalBackendFactoryClass *class)
 {
-       GType type;
-
-       GTypeInfo info = {
-               sizeof (ECalBackendFileFactoryClass),
-               NULL, /* base_class_init */
-               NULL, /* base_class_finalize */
-               (GClassInitFunc)  todos_backend_factory_class_init,
-               NULL, /* class_finalize */
-               NULL, /* class_data */
-               sizeof (ECalBackend),
-               0,    /* n_preallocs */
-               (GInstanceInitFunc) e_cal_backend_file_factory_instance_init
-       };
+}
 
-       type = g_type_module_register_type (module,
-                                           E_TYPE_CAL_BACKEND_FACTORY,
-                                           "ECalBackendFileTodosFactory",
-                                           &info, 0);
+static void
+e_cal_backend_file_journal_factory_init (ECalBackendFactory *factory)
+{
+}
 
-       return type;
+static void
+e_cal_backend_file_todos_factory_class_init (ECalBackendFactoryClass *class)
+{
+       class->get_protocol = _get_protocol;
+       class->get_kind     = _todos_get_kind;
+       class->new_backend  = _todos_new_backend;
 }
 
-\f
+static void
+e_cal_backend_file_todos_factory_class_finalize (ECalBackendFactoryClass *class)
+{
+}
 
-static GType file_types[3];
+static void
+e_cal_backend_file_todos_factory_init (ECalBackendFactory *factory)
+{
+}
 
 void
-eds_module_initialize (GTypeModule *module)
+eds_module_initialize (GTypeModule *type_module)
 {
-       file_types[0] = todos_backend_factory_get_type (module);
-       file_types[1] = events_backend_factory_get_type (module);
-       file_types[2] = journal_backend_factory_get_type (module);
+       e_cal_backend_file_events_factory_register_type (type_module);
+       e_cal_backend_file_journal_factory_register_type (type_module);
+       e_cal_backend_file_todos_factory_register_type (type_module);
 }
 
 void
-eds_module_shutdown   (void)
+eds_module_shutdown (void)
 {
 }
 
 void
 eds_module_list_types (const GType **types, gint *num_types)
 {
+       static GType file_types[3];
+
+       file_types[0] = e_cal_backend_file_events_factory_get_type ();
+       file_types[1] = e_cal_backend_file_journal_factory_get_type ();
+       file_types[2] = e_cal_backend_file_todos_factory_get_type ();
+
        *types = file_types;
-       *num_types = 3;
+       *num_types = G_N_ELEMENTS (file_types);
 }
index e7c1958..553233d 100644 (file)
@@ -1265,14 +1265,16 @@ e_cal_backend_file_open (ECalBackendSync *backend, EDataCal *cal, GCancellable *
 
        if (!err) {
                if (!priv->read_only) {
-                       ESource *source = e_cal_backend_get_source (E_CAL_BACKEND (backend));
+                       ESource *source;
 
-                       if (source) {
-                               g_signal_connect (source, "changed", G_CALLBACK (source_changed_cb), backend);
+                       source = e_cal_backend_get_source (E_CAL_BACKEND (backend));
 
-                               if (e_source_get_property (source, "custom-file-readonly") && g_str_equal (e_source_get_property (source, "custom-file-readonly"), "1"))
-                                       priv->read_only = TRUE;
-                       }
+                       g_signal_connect (
+                               source, "changed",
+                               G_CALLBACK (source_changed_cb), backend);
+
+                       if (e_source_get_property (source, "custom-file-readonly") && g_str_equal (e_source_get_property (source, "custom-file-readonly"), "1"))
+                               priv->read_only = TRUE;
                }
        }
 
@@ -1298,7 +1300,8 @@ e_cal_backend_file_remove (ECalBackendSync *backend, EDataCal *cal, GCancellable
        gchar *full_path = NULL;
        const gchar *fname;
        GDir *dir = NULL;
-       GError *error = NULL, *err = NULL;
+       GError *local_error = NULL;
+       GError *err = NULL;
 
        cbfile = E_CAL_BACKEND_FILE (backend);
        priv = cbfile->priv;
@@ -1317,9 +1320,10 @@ e_cal_backend_file_remove (ECalBackendSync *backend, EDataCal *cal, GCancellable
 
        /* remove all files in the directory */
        dirname = g_path_get_dirname (str_uri);
-       dir = g_dir_open (dirname, 0, &error);
+       dir = g_dir_open (dirname, 0, &local_error);
        if (!dir) {
-               err = e_data_cal_create_error (PermissionDenied, error ? error->message : NULL);
+               err = e_data_cal_create_error (
+                       PermissionDenied, local_error->message);
                goto done;
        }
 
@@ -1362,8 +1366,8 @@ e_cal_backend_file_remove (ECalBackendSync *backend, EDataCal *cal, GCancellable
 
        g_static_rec_mutex_unlock (&priv->idle_save_rmutex);
 
-       if (error)
-               g_error_free (error);
+       if (local_error)
+               g_error_free (local_error);
 }
 
 /* Set_mode handler for the file backend */
@@ -3152,9 +3156,11 @@ e_cal_backend_file_reload (ECalBackendFile *cbfile, GError **perror)
        g_free (str_uri);
 
        if (!err && !priv->read_only) {
-               ESource *source = e_cal_backend_get_source (E_CAL_BACKEND (cbfile));
+               ESource *source;
+
+               source = e_cal_backend_get_source (E_CAL_BACKEND (cbfile));
 
-               if (source && e_source_get_property (source, "custom-file-readonly") && g_str_equal (e_source_get_property (source, "custom-file-readonly"), "1"))
+               if (e_source_get_property (source, "custom-file-readonly") && g_str_equal (e_source_get_property (source, "custom-file-readonly"), "1"))
                        priv->read_only = TRUE;
        }
   done:
index 840762f..33a4f35 100644 (file)
 #include "e-cal-backend-http-factory.h"
 #include "e-cal-backend-http.h"
 
-typedef struct {
-       ECalBackendFactory            parent_object;
-} ECalBackendHttpFactory;
+typedef ECalBackendFactory ECalBackendHttpEventsFactory;
+typedef ECalBackendFactoryClass ECalBackendHttpEventsFactoryClass;
 
-typedef struct {
-       ECalBackendFactoryClass parent_class;
-} ECalBackendHttpFactoryClass;
+typedef ECalBackendFactory ECalBackendHttpJournalFactory;
+typedef ECalBackendFactoryClass ECalBackendHttpJournalFactoryClass;
 
-static void
-e_cal_backend_http_factory_instance_init (ECalBackendHttpFactory *factory)
-{
-}
+typedef ECalBackendFactory ECalBackendHttpTodosFactory;
+typedef ECalBackendFactoryClass ECalBackendHttpTodosFactoryClass;
+
+/* Forward Declarations */
+GType e_cal_backend_http_events_factory_get_type (void);
+GType e_cal_backend_http_journal_factory_get_type (void);
+GType e_cal_backend_http_todos_factory_get_type (void);
+
+G_DEFINE_DYNAMIC_TYPE (
+       ECalBackendHttpEventsFactory,
+       e_cal_backend_http_events_factory,
+       E_TYPE_CAL_BACKEND_FACTORY)
+
+G_DEFINE_DYNAMIC_TYPE (
+       ECalBackendHttpJournalFactory,
+       e_cal_backend_http_journal_factory,
+       E_TYPE_CAL_BACKEND_FACTORY)
+
+G_DEFINE_DYNAMIC_TYPE (
+       ECalBackendHttpTodosFactory,
+       e_cal_backend_http_todos_factory,
+       E_TYPE_CAL_BACKEND_FACTORY)
 
 static const gchar *
 _get_protocol (ECalBackendFactory *factory)
@@ -35,170 +51,130 @@ _get_protocol (ECalBackendFactory *factory)
        return "webcal";
 }
 
-static ECalBackend*
-_todos_new_backend (ECalBackendFactory *factory, ESource *source)
+static icalcomponent_kind
+_events_get_kind (ECalBackendFactory *factory)
+{
+       return ICAL_VEVENT_COMPONENT;
+}
+
+static ECalBackend *
+_events_new_backend (ECalBackendFactory *factory,
+                     ESource *source)
 {
-       return g_object_new (e_cal_backend_http_get_type (),
-                            "source", source,
-                            "kind", ICAL_VTODO_COMPONENT,
-                            NULL);
+       return g_object_new (
+               e_cal_backend_http_get_type (),
+               "kind", ICAL_VEVENT_COMPONENT,
+               "source", source, NULL);
 }
 
 static icalcomponent_kind
-_todos_get_kind (ECalBackendFactory *factory)
+_journal_get_kind (ECalBackendFactory *factory)
 {
-       return ICAL_VTODO_COMPONENT;
+       return ICAL_VJOURNAL_COMPONENT;
 }
 
-static ECalBackend*
-_events_new_backend (ECalBackendFactory *factory, ESource *source)
+static ECalBackend *
+_journal_new_backend (ECalBackendFactory *factory,
+                      ESource *source)
 {
-       return g_object_new (e_cal_backend_http_get_type (),
-                            "source", source,
-                            "kind", ICAL_VEVENT_COMPONENT,
-                            NULL);
+       return g_object_new (
+               e_cal_backend_http_get_type (),
+               "kind", ICAL_VJOURNAL_COMPONENT,
+               "source", source, NULL);
 }
 
 static icalcomponent_kind
-_events_get_kind (ECalBackendFactory *factory)
+_todos_get_kind (ECalBackendFactory *factory)
 {
-       return ICAL_VEVENT_COMPONENT;
+       return ICAL_VTODO_COMPONENT;
 }
 
-static ECalBackend*
-_memos_new_backend (ECalBackendFactory *factory, ESource *source)
+static ECalBackend *
+_todos_new_backend (ECalBackendFactory *factory,
+                    ESource *source)
 {
-       return g_object_new (e_cal_backend_http_get_type (),
-                            "source", source,
-                            "kind", ICAL_VJOURNAL_COMPONENT,
-                            NULL);
+       return g_object_new (
+               e_cal_backend_http_get_type (),
+               "kind", ICAL_VTODO_COMPONENT,
+               "source", source, NULL);
 }
 
-static icalcomponent_kind
-_memos_get_kind (ECalBackendFactory *factory)
+static void
+e_cal_backend_http_events_factory_class_init (ECalBackendFactoryClass *class)
 {
-       return ICAL_VJOURNAL_COMPONENT;
+       class->get_protocol = _get_protocol;
+       class->get_kind     = _events_get_kind;
+       class->new_backend  = _events_new_backend;
 }
 
 static void
-todos_backend_factory_class_init (ECalBackendHttpFactoryClass *klass)
+e_cal_backend_http_events_factory_class_finalize (ECalBackendFactoryClass *class)
 {
-       E_CAL_BACKEND_FACTORY_CLASS (klass)->get_protocol = _get_protocol;
-       E_CAL_BACKEND_FACTORY_CLASS (klass)->get_kind     = _todos_get_kind;
-       E_CAL_BACKEND_FACTORY_CLASS (klass)->new_backend  = _todos_new_backend;
 }
 
 static void
-events_backend_factory_class_init (ECalBackendHttpFactoryClass *klass)
+e_cal_backend_http_events_factory_init (ECalBackendFactory *factory)
 {
-       E_CAL_BACKEND_FACTORY_CLASS (klass)->get_protocol = _get_protocol;
-       E_CAL_BACKEND_FACTORY_CLASS (klass)->get_kind     = _events_get_kind;
-       E_CAL_BACKEND_FACTORY_CLASS (klass)->new_backend  = _events_new_backend;
 }
 
 static void
-memos_backend_factory_class_init (ECalBackendHttpFactoryClass *klass)
+e_cal_backend_http_journal_factory_class_init (ECalBackendFactoryClass *class)
 {
-       E_CAL_BACKEND_FACTORY_CLASS (klass)->get_protocol = _get_protocol;
-       E_CAL_BACKEND_FACTORY_CLASS (klass)->get_kind     = _memos_get_kind;
-       E_CAL_BACKEND_FACTORY_CLASS (klass)->new_backend  = _memos_new_backend;
+       class->get_protocol = _get_protocol;
+       class->get_kind     = _journal_get_kind;
+       class->new_backend  = _journal_new_backend;
 }
 
-static GType
-events_backend_factory_get_type (GTypeModule *module)
+static void
+e_cal_backend_http_journal_factory_class_finalize (ECalBackendFactoryClass *class)
 {
-       GType type;
-
-       GTypeInfo info = {
-               sizeof (ECalBackendHttpFactoryClass),
-               NULL, /* base_class_init */
-               NULL, /* base_class_finalize */
-               (GClassInitFunc)  events_backend_factory_class_init,
-               NULL, /* class_finalize */
-               NULL, /* class_data */
-               sizeof (ECalBackend),
-               0,    /* n_preallocs */
-               (GInstanceInitFunc) e_cal_backend_http_factory_instance_init
-       };
-
-       type = g_type_module_register_type (module,
-                                           E_TYPE_CAL_BACKEND_FACTORY,
-                                           "ECalBackendHttpEventsFactory",
-                                           &info, 0);
-
-       return type;
 }
 
-static GType
-todos_backend_factory_get_type (GTypeModule *module)
+static void
+e_cal_backend_http_journal_factory_init (ECalBackendFactory *factory)
 {
-       GType type;
-
-       GTypeInfo info = {
-               sizeof (ECalBackendHttpFactoryClass),
-               NULL, /* base_class_init */
-               NULL, /* base_class_finalize */
-               (GClassInitFunc)  todos_backend_factory_class_init,
-               NULL, /* class_finalize */
-               NULL, /* class_data */
-               sizeof (ECalBackend),
-               0,    /* n_preallocs */
-               (GInstanceInitFunc) e_cal_backend_http_factory_instance_init
-       };
-
-       type = g_type_module_register_type (module,
-                                           E_TYPE_CAL_BACKEND_FACTORY,
-                                           "ECalBackendHttpTodosFactory",
-                                           &info, 0);
-
-       return type;
 }
 
-static GType
-memos_backend_factory_get_type (GTypeModule *module)
+static void
+e_cal_backend_http_todos_factory_class_init (ECalBackendFactoryClass *class)
 {
-       GType type;
-
-       GTypeInfo info = {
-               sizeof (ECalBackendHttpFactoryClass),
-               NULL, /* base_class_init */
-               NULL, /* base_class_finalize */
-               (GClassInitFunc)  memos_backend_factory_class_init,
-               NULL, /* class_finalize */
-               NULL, /* class_data */
-               sizeof (ECalBackend),
-               0,    /* n_preallocs */
-               (GInstanceInitFunc) e_cal_backend_http_factory_instance_init
-       };
-
-       type = g_type_module_register_type (module,
-                                           E_TYPE_CAL_BACKEND_FACTORY,
-                                           "ECalBackendHttpMemosFactory",
-                                           &info, 0);
-
-       return type;
+       class->get_protocol = _get_protocol;
+       class->get_kind     = _todos_get_kind;
+       class->new_backend  = _todos_new_backend;
 }
 
-\f
+static void
+e_cal_backend_http_todos_factory_class_finalize (ECalBackendFactoryClass *class)
+{
+}
 
-static GType http_types[3];
+static void
+e_cal_backend_http_todos_factory_init (ECalBackendFactory *factory)
+{
+}
 
 void
-eds_module_initialize (GTypeModule *module)
+eds_module_initialize (GTypeModule *type_module)
 {
-       http_types[0] = todos_backend_factory_get_type (module);
-       http_types[1] = events_backend_factory_get_type (module);
-       http_types[2] = memos_backend_factory_get_type (module);
+       e_cal_backend_http_events_factory_register_type (type_module);
+       e_cal_backend_http_journal_factory_register_type (type_module);
+       e_cal_backend_http_todos_factory_register_type (type_module);
 }
 
 void
-eds_module_shutdown   (void)
+eds_module_shutdown (void)
 {
 }
 
 void
 eds_module_list_types (const GType **types, gint *num_types)
 {
+       static GType http_types[3];
+
+       http_types[0] = e_cal_backend_http_events_factory_get_type ();
+       http_types[1] = e_cal_backend_http_journal_factory_get_type ();
+       http_types[2] = e_cal_backend_http_todos_factory_get_type ();
+
        *types = http_types;
-       *num_types = 3;
+       *num_types = G_N_ELEMENTS (http_types);
 }
index e468a39..97a8fc6 100644 (file)
@@ -697,12 +697,16 @@ source_changed_cb (ESource *source, ECalBackendHttp *cbhttp)
        priv = cbhttp->priv;
 
        if (priv->uri) {
-               ESource *source = e_cal_backend_get_source (E_CAL_BACKEND (cbhttp));
-               const gchar *secure_prop = e_source_get_property (source, "use_ssl");
+               ESource *source;
+               const gchar *secure_prop;
                gchar *new_uri;
 
-               new_uri = webcal_to_http_method (e_cal_backend_get_uri (E_CAL_BACKEND (cbhttp)),
-                                                (secure_prop && g_str_equal(secure_prop, "1")));
+               source = e_cal_backend_get_source (E_CAL_BACKEND (cbhttp));
+               secure_prop = e_source_get_property (source, "use_ssl");
+
+               new_uri = webcal_to_http_method (
+                       e_cal_backend_get_uri (E_CAL_BACKEND (cbhttp)),
+                       (secure_prop && g_str_equal(secure_prop, "1")));
 
                if (new_uri && !g_str_equal (priv->uri, new_uri)) {
                        /* uri changed, do reload some time soon */
index 6059375..8b0cda8 100644 (file)
 #include "e-cal-backend-weather-factory.h"
 #include "e-cal-backend-weather.h"
 
-typedef struct {
-       ECalBackendFactory parent_object;
-} ECalBackendWeatherFactory;
+typedef ECalBackendFactory ECalBackendWeatherEventsFactory;
+typedef ECalBackendFactoryClass ECalBackendWeatherEventsFactoryClass;
 
-typedef struct {
-       ECalBackendWeatherClass parent_class;
-} ECalBackendWeatherFactoryClass;
+/* Forward Declarations */
+GType e_cal_backend_weather_events_factory_get_type (void);
 
-static void
-e_cal_backend_weather_factory_instance_init (ECalBackendWeatherFactory *factory)
-{
-}
+G_DEFINE_DYNAMIC_TYPE (
+       ECalBackendWeatherEventsFactory,
+       e_cal_backend_weather_events_factory,
+       E_TYPE_CAL_BACKEND_FACTORY)
 
 static const gchar *
 _get_protocol (ECalBackendFactory *factory)
@@ -46,58 +44,44 @@ _get_protocol (ECalBackendFactory *factory)
        return "weather";
 }
 
-static ECalBackend*
-_events_new_backend (ECalBackendFactory *factory, ESource *source)
-{
-       return g_object_new (e_cal_backend_weather_get_type (),
-                            "source", source,
-                            "kind", ICAL_VEVENT_COMPONENT,
-                            NULL);
-}
-
 static icalcomponent_kind
 _events_get_kind (ECalBackendFactory *factory)
 {
        return ICAL_VEVENT_COMPONENT;
 }
 
+static ECalBackend *
+_events_new_backend (ECalBackendFactory *factory,
+                     ESource *source)
+{
+       return g_object_new (
+               e_cal_backend_weather_get_type (),
+               "kind", ICAL_VEVENT_COMPONENT,
+               "source", source, NULL);
+}
+
 static void
-events_backend_factory_class_init (ECalBackendWeatherFactoryClass *klass)
+e_cal_backend_weather_events_factory_class_init (ECalBackendFactoryClass *class)
 {
-       E_CAL_BACKEND_FACTORY_CLASS (klass)->get_protocol = _get_protocol;
-       E_CAL_BACKEND_FACTORY_CLASS (klass)->get_kind     = _events_get_kind;
-       E_CAL_BACKEND_FACTORY_CLASS (klass)->new_backend  = _events_new_backend;
+       class->get_protocol = _get_protocol;
+       class->get_kind     = _events_get_kind;
+       class->new_backend  = _events_new_backend;
 }
 
-static GType
-events_backend_factory_get_type (GTypeModule *module)
+static void
+e_cal_backend_weather_events_factory_class_finalize (ECalBackendFactoryClass *class)
 {
-       GType type;
-       GTypeInfo info = {
-               sizeof (ECalBackendWeatherFactoryClass),
-               NULL, /* base_class_init */
-               NULL, /* base_class_finalize */
-               (GClassInitFunc) events_backend_factory_class_init,
-               NULL, /* class_finalize */
-               NULL, /* class_data */
-               sizeof (ECalBackend),
-               0, /* n_preallocs */
-               (GInstanceInitFunc) e_cal_backend_weather_factory_instance_init
-       };
-       type = g_type_module_register_type (module,
-                                           E_TYPE_CAL_BACKEND_FACTORY,
-                                           "ECalBackendWeatherEventsFactory",
-                                           &info, 0);
-
-       return type;
 }
 
-static GType weather_type[1];
+static void
+e_cal_backend_weather_events_factory_init (ECalBackendFactory *factory)
+{
+}
 
 void
-eds_module_initialize (GTypeModule *module)
+eds_module_initialize (GTypeModule *type_module)
 {
-       weather_type[0] = events_backend_factory_get_type (module);
+       e_cal_backend_weather_events_factory_register_type (type_module);
 }
 
 void
@@ -108,6 +92,10 @@ eds_module_shutdown (void)
 void
 eds_module_list_types (const GType **types, gint *num_types)
 {
-       *types = weather_type;
-       *num_types = 1;
+       static GType weather_types[1];
+
+       weather_types[0] = e_cal_backend_weather_events_factory_get_type ();
+
+       *types = weather_types;
+       *num_types = G_N_ELEMENTS (weather_types);
 }
index cb2503b..d1f7d9c 100644 (file)
@@ -268,7 +268,9 @@ begin_retrieval_cb (ECalBackendWeather *cbw)
 
        priv->is_loading = TRUE;
 
-       e_weather_source_parse (priv->source, (EWeatherSourceFinished) finished_retrieval_cb, cbw);
+       e_weather_source_parse (
+               priv->source, (EWeatherSourceFinished)
+               finished_retrieval_cb, cbw);
 
        return FALSE;
 }
index f8735ec..e1924a5 100644 (file)
@@ -416,7 +416,9 @@ parse_done (WeatherInfo *info, gpointer data)
 }
 
 static void
-e_weather_source_ccf_parse (EWeatherSource *source, EWeatherSourceFinished done, gpointer data)
+e_weather_source_ccf_parse (EWeatherSource *source,
+                            EWeatherSourceFinished done,
+                            gpointer data)
 {
        EWeatherSourceCCF *ccfsource = (EWeatherSourceCCF*) source;
        WeatherPrefs prefs;
@@ -446,8 +448,7 @@ e_weather_source_ccf_class_init (EWeatherSourceCCFClass *class)
 {
        EWeatherSourceClass *source_class;
 
-       source_class = (EWeatherSourceClass *) class;
-
+       source_class = E_WEATHER_SOURCE_CLASS (class);
        source_class->parse = e_weather_source_ccf_parse;
 }
 
index ad697f8..1832b72 100644 (file)
 #include <libgweather/weather.h>
 #undef GWEATHER_I_KNOW_THIS_IS_UNSTABLE
 
-G_BEGIN_DECLS
+/* Standard GObject macros */
+#define E_TYPE_WEATHER_SOURCE_CCF \
+       (e_weather_source_ccf_get_type ())
+#define E_WEATHER_SOURCE_CCF(obj) \
+       (G_TYPE_CHECK_INSTANCE_CAST \
+       ((obj), E_TYPE_WEATHER_SOURCE_CCF, EWeatherSourceCCF))
+#define E_WEATHER_SOURCE_CCF_CLASS(cls) \
+       (G_TYPE_CHECK_CLASS_CAST \
+       ((cls), E_TYPE_WEATHER_SOURCE_CCF, EWeatherSourceCCF))
+#define E_IS_WEATHER_SOURCE_CCF(obj) \
+       (G_TYPE_CHECK_INSTANCE_TYPE \
+       ((obj), E_TYPE_WEATHER_SOURCE_CCF))
+#define E_IS_WEATHER_SOURCE_CCF_CLASS(cls) \
+       (G_TYPE_CHECK_CLASS_TYPE \
+       ((cls), E_TYPE_WEATHER_SOURCE_CCF))
+#define E_WEATHER_SOURCE_CCF_GET_CLASS(obj) \
+       (G_TYPE_INSTANCE_GET_CLASS \
+       ((obj), E_TYPE_WEATHER_SOURCE_CCF, EWeatherSourceCCF))
 
-#define E_TYPE_WEATHER_SOURCE_CCF            (e_weather_source_ccf_get_type ())
-#define E_WEATHER_SOURCE_CCF(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_WEATHER_SOURCE_CCF, EWeatherSourceCCF))
-#define E_WEATHER_SOURCE_CCF_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_WEATHER_SOURCE_CCF, EWeatherSourceCCF))
-#define E_IS_WEATHER_SOURCE_CCF(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_WEATHER_SOURCE_CCF))
-#define E_IS_WEATHER_SOURCE_CCF_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), E_TYPE_WEATHER_SOURCE_CCF))
+G_BEGIN_DECLS
 
 typedef struct _EWeatherSourceCCF EWeatherSourceCCF;
 typedef struct _EWeatherSourceCCFClass EWeatherSourceCCFClass;
@@ -55,9 +68,9 @@ struct _EWeatherSourceCCFClass {
        EWeatherSourceClass parent_class;
 };
 
-EWeatherSource*        e_weather_source_ccf_new (const gchar *uri);
-GType          e_weather_source_ccf_get_type (void);
+GType          e_weather_source_ccf_get_type   (void);
+EWeatherSource *e_weather_source_ccf_new       (const gchar *uri);
 
 G_END_DECLS
 
-#endif
+#endif /* E_WEATHER_SOURCE_CCF_H */
index 539390a..74ea669 100644 (file)
 G_DEFINE_TYPE (EWeatherSource, e_weather_source, G_TYPE_OBJECT)
 
 void
-e_weather_source_parse (EWeatherSource *source, EWeatherSourceFinished done, gpointer data)
+e_weather_source_parse (EWeatherSource *source,
+                        EWeatherSourceFinished done,
+                        gpointer data)
 {
        EWeatherSourceClass *class;
+
        g_return_if_fail (source != NULL);
-       class = (EWeatherSourceClass*) G_OBJECT_GET_CLASS (source);
+
+       class = E_WEATHER_SOURCE_GET_CLASS (source);
+       g_return_if_fail (class->parse != NULL);
+
        class->parse (source, done, data);
 }
 
@@ -46,7 +52,8 @@ e_weather_source_init (EWeatherSource *source)
        /* nothing to do here */
 }
 
-EWeatherSource*        e_weather_source_new (const gchar *uri)
+EWeatherSource *
+e_weather_source_new (const gchar *uri)
 {
        const gchar *base = uri + 10; /* skip weather:// */
 
index 175d9fa..e5e94cc 100644 (file)
 #include <libgweather/weather.h>
 #undef GWEATHER_I_KNOW_THIS_IS_UNSTABLE
 
+/* Standard GObject macros */
+#define E_TYPE_WEATHER_SOURCE \
+       (e_weather_source_get_type ())
+#define E_WEATHER_SOURCE(obj) \
+       (G_TYPE_CHECK_INSTANCE_CAST \
+       ((obj), E_TYPE_WEATHER_SOURCE, EWeatherSource))
+#define E_WEATHER_SOURCE_CLASS(cls) \
+       (G_TYPE_CHECK_CLASS_CAST \
+       ((cls), E_TYPE_WEATHER_SOURCE, EWeatherSourceClass))
+#define E_IS_WEATHER_SOURCE(obj) \
+       (G_TYPE_CHECK_INSTANCE_TYPE \
+       ((obj), E_TYPE_WEATHER_SOURCE))
+#define E_IS_WEATHER_SOURCE_CLASS(cls) \
+       (G_TYPE_CHECK_CLASS_TYPE \
+       ((cls), E_TYPE_WEATHER_SOURCE))
+#define E_WEATHER_SOURCE_GET_CLASS(obj) \
+       (G_TYPE_INSTANCE_GET_CLASS \
+       ((obj), E_TYPE_WEATHER_SOURCE, EWeatherSourceClass))
+
 G_BEGIN_DECLS
 
 typedef enum {
@@ -60,12 +79,6 @@ typedef enum {
 
 typedef void (*EWeatherSourceFinished)(WeatherInfo *result, gpointer data);
 
-#define E_TYPE_WEATHER_SOURCE            (e_weather_source_get_type ())
-#define E_WEATHER_SOURCE(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_WEATHER_SOURCE, EWeatherSource))
-#define E_WEATHER_SOURCE_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_WEATHER_SOURCE, EWeatherSource))
-#define E_IS_WEATHER_SOURCE(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_WEATHER_SOURCE))
-#define E_IS_WEATHER_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), E_TYPE_WEATHER_SOURCE))
-
 typedef struct _EWeatherSource EWeatherSource;
 typedef struct _EWeatherSourceClass EWeatherSourceClass;
 
@@ -73,7 +86,7 @@ typedef struct _EWeatherSourceClass EWeatherSourceClass;
  * All the URL fetching is handled outside of this, and all this has
  * to know how to do is parse the specific format. */
 struct _EWeatherSource {
-       GObject object;
+       GObject parent;
 };
 
 struct _EWeatherSourceClass {
@@ -81,13 +94,17 @@ struct _EWeatherSourceClass {
 
        /* Returns a list of WeatherForecast objects containing the
         * data for the forecast. */
-       void (*parse)   (EWeatherSource *source, EWeatherSourceFinished done, gpointer data);
+       void            (*parse)        (EWeatherSource *source,
+                                        EWeatherSourceFinished done,
+                                        gpointer data);
 };
 
-EWeatherSource*        e_weather_source_new (const gchar *uri);
-GType  e_weather_source_get_type (void);
-void   e_weather_source_parse (EWeatherSource *source, EWeatherSourceFinished done, gpointer data);
+GType          e_weather_source_get_type       (void);
+EWeatherSource *e_weather_source_new           (const gchar *uri);
+void           e_weather_source_parse          (EWeatherSource *source,
+                                                EWeatherSourceFinished done,
+                                                gpointer data);
 
 G_END_DECLS
 
-#endif
+#endif /* E_WEATHER_SOURCE_H */
index 0dd0e10..2cfa75e 100644 (file)
@@ -1114,7 +1114,9 @@ e_cal_new (ESource *source, ECalSourceType type)
 {
        ECal *ecal;
        ECalPrivate *priv;
-       gchar *path, *xml, **strv;
+       gchar *path;
+       gchar *xml;
+       gchar **strv;
        GError *error = NULL;
        GDBusConnection *connection;
 
@@ -4463,12 +4465,14 @@ e_cal_open_default (ECal **ecal,
                return FALSE;
        }
 
-       /* XXX This can fail but doesn't take a GError!? */
+       /* XXX So this can fail, but doesn't take a GError!? */
        client = e_cal_new (source, type);
-       if (!client) {
-               g_set_error_literal (error, E_CALENDAR_ERROR,
-                            E_CALENDAR_STATUS_OTHER_ERROR,
-                            e_cal_get_error_message (E_CALENDAR_STATUS_OTHER_ERROR));
+
+       if (client == NULL) {
+               g_set_error_literal (
+                       error, E_CALENDAR_ERROR,
+                       E_CALENDAR_STATUS_OTHER_ERROR,
+                       e_cal_get_error_message (E_CALENDAR_STATUS_OTHER_ERROR));
                g_object_unref (source_list);
                return FALSE;
        }
@@ -4489,10 +4493,10 @@ e_cal_open_default (ECal **ecal,
 
 /**
  * e_cal_set_default:
- * @ecal: A calendar client.
- * @error: Placeholder for error information.
+ * @ecal: an #ECal
+ * @error: return location for a #GError, or %NULL
  *
- * Sets a calendar as the default one.
+ * Sets the #ESource in @ecal as default.
  *
  * Returns: TRUE if the operation was successful, FALSE otherwise.
  *
@@ -4502,18 +4506,14 @@ gboolean
 e_cal_set_default (ECal *ecal, GError **error)
 {
        ESource *source;
+       ECalSourceType source_type;
 
-       e_return_error_if_fail (ecal && E_IS_CAL (ecal), E_CALENDAR_STATUS_INVALID_ARG);
+       g_return_val_if_fail (E_IS_CAL (ecal), FALSE);
 
        source = e_cal_get_source (ecal);
-       if (!source) {
-               g_set_error_literal (error, E_CALENDAR_ERROR,
-                            E_CALENDAR_STATUS_NO_SUCH_CALENDAR,
-                            e_cal_get_error_message (E_CALENDAR_STATUS_NO_SUCH_CALENDAR));
-               return FALSE;
-       }
+       source_type = e_cal_get_source_type (ecal);
 
-       return e_cal_set_default_source (source, ecal->priv->type, error);
+       return e_cal_set_default_source (source, source_type, error);
 }
 
 static gboolean
@@ -4559,18 +4559,20 @@ set_default_source (ESourceList *sources, ESource *source, GError **error)
 
 /**
  * e_cal_set_default_source:
- * @source: An #ESource.
- * @type: Type of the source.
- * @error: Placeholder for error information.
+ * @source: an #ESource
+ * @type: type of the source
+ * @error: return location for a #GError, or %NULL
  *
- * Sets the default source for the specified @type.
+ * Sets @source as the default source for the specified @type.
  *
  * Returns: TRUE if the operation was successful, FALSE otherwise.
  *
  * Deprecated: 3.2: Use e_cal_client_set_default_source() instead.
  */
 gboolean
-e_cal_set_default_source (ESource *source, ECalSourceType type, GError **error)
+e_cal_set_default_source (ESource *source,
+                          ECalSourceType type,
+                          GError **error)
 {
        ESourceList *sources;
        GError *err = NULL;
index a1dc014..ae003e7 100644 (file)
@@ -24,9 +24,8 @@
 
 #ifndef E_CAL_DISABLE_DEPRECATED
 
-#include <glib-object.h>
-#include "libedataserver/e-source-list.h"
-#include "libedataserver/e-source.h"
+#include <libedataserver/e-source-list.h>
+#include <libedataserver/e-source.h>
 #include <libecal/e-cal-recur.h>
 #include <libecal/e-cal-util.h>
 #include <libecal/e-cal-view.h>
index a65051f..2fcb4de 100644 (file)
@@ -117,7 +117,6 @@ cal_backend_set_default_cache_dir (ECalBackend *backend)
 
        kind = e_cal_backend_get_kind (backend);
        source = e_cal_backend_get_source (backend);
-       g_return_if_fail (source != NULL);
 
        switch (kind) {
                case ICAL_VEVENT_COMPONENT:
index 8e64ffb..4dc83f0 100644 (file)
 #endif
 #endif
 
-#include "libedataserver/e-url.h"
-#include "libedataserver/e-source.h"
-#include "libedataserver/e-source-list.h"
-#include "libebackend/e-data-server-module.h"
+#include <libedataserver/e-url.h>
+#include <libedataserver/e-source-list.h>
+#include <libebackend/e-data-server-module.h>
 #include <libebackend/e-offline-listener.h>
-#include "libecal/e-cal.h"
+#include <libecal/e-cal.h>
 #include "e-cal-backend.h"
 #include "e-cal-backend-factory.h"
 #include "e-data-cal.h"
@@ -341,12 +340,15 @@ find_backend_cb (gpointer key, gpointer value, gpointer data)
 }
 
 static gboolean
-impl_CalFactory_getCal (EGdbusCalFactory *object, GDBusMethodInvocation *invocation, const gchar * const *in_source_type, EDataCalFactory *factory)
+impl_CalFactory_getCal (EGdbusCalFactory *object,
+                        GDBusMethodInvocation *invocation,
+                        const gchar * const *in_source_type,
+                        EDataCalFactory *factory)
 {
        EDataCal *calendar;
+       ECalBackend *backend;
        EDataCalFactoryPrivate *priv = factory->priv;
        ECalBackendFactory *backend_factory;
-       ECalBackend *backend;
        ESource *source;
        gchar *str_uri;
        EUri *uri;
@@ -489,7 +491,9 @@ impl_CalFactory_getCal (EGdbusCalFactory *object, GDBusMethodInvocation *invocat
                g_hash_table_insert (
                        priv->backends, g_strdup (uid_type_string), backend);
 
-               g_signal_connect (backend, "last-client-gone", G_CALLBACK (last_client_gone_cb), factory);
+               g_signal_connect (
+                       backend, "last-client-gone",
+                       G_CALLBACK (last_client_gone_cb), factory);
                e_cal_backend_set_online (backend, priv->is_online);
        } else if (!e_source_equal (source, e_cal_backend_get_source (backend))) {
                /* source changed, update it in a backend */
@@ -1009,7 +1013,8 @@ main (gint argc, gchar **argv)
                eol, "changed",
                G_CALLBACK (offline_state_changed_cb), factory);
 
-       owner_id = g_bus_own_name (G_BUS_TYPE_SESSION,
+       owner_id = g_bus_own_name (
+               G_BUS_TYPE_SESSION,
                CALENDAR_DBUS_SERVICE_NAME,
                G_BUS_NAME_OWNER_FLAGS_NONE,
                on_bus_acquired,
index 5c85b29..06bd94a 100644 (file)
@@ -319,7 +319,6 @@ PKG_CHECK_MODULES(GNOME_PLATFORM,
        libsoup-2.4 >= libsoup_minimum_version
        libgdata >= libgdata_minimum_version])
 
-
 if test x$os_win32 = xno; then
   dnl ***********************************
   dnl Check for GNOME Keyring.
index 822860e..c2db5fc 100644 (file)
@@ -29,7 +29,7 @@
 #include <glib/gi18n-lib.h>
 #include <libebook/e-book.h>
 #include <libedataserverui/e-passwords.h>
-#include "libedataserver/e-url.h"
+#include <libedataserver/e-url.h>
 #include "e-book-auth-util.h"
 
 static void addressbook_authenticate (EBook *book, gboolean previous_failure,
index bd66153..16558b9 100644 (file)
@@ -29,6 +29,7 @@
 #include <string.h>
 #include <gdk/gdkkeysyms.h>
 #include <glib/gi18n-lib.h>
+#include <gconf/gconf-client.h>
 #include <libedataserverui/e-source-combo-box.h>
 #include <libedataserverui/e-destination-store.h>
 #include <libedataserverui/e-contact-store.h>
index fbb2149..18be4cd 100644 (file)
@@ -24,6 +24,7 @@
 #include <config.h>
 #include <string.h>
 #include <glib/gi18n-lib.h>
+#include <gconf/gconf-client.h>
 
 #include <camel/camel.h>
 #include <libebook/e-book.h>
index 2416661..8f5233a 100644 (file)
@@ -25,7 +25,7 @@
 
 #include <glib.h>
 
-#include "libedataserver/e-source-list.h"
+#include <libedataserver/e-source-list.h>
 #include <libedataserverui/e-name-selector-model.h>
 #include <libedataserverui/e-name-selector-dialog.h>
 #include <libedataserverui/e-name-selector-entry.h>
index 6086b44..d66f4a0 100644 (file)
@@ -350,26 +350,26 @@ e_source_combo_box_new (ESourceList *source_list)
 
 /**
  * e_source_combo_box_get_source_list:
- * @source_combo_box: an #ESourceComboBox
+ * @combo_box: an #ESourceComboBox
  *
  * Returns the #ESourceList which is acting as a data source for
- * @source_combo_box.
+ * @combo_box.
  *
  * Returns: an #ESourceList
  *
  * Since: 2.22
  **/
 ESourceList *
-e_source_combo_box_get_source_list (ESourceComboBox *source_combo_box)
+e_source_combo_box_get_source_list (ESourceComboBox *combo_box)
 {
-       g_return_val_if_fail (E_IS_SOURCE_COMBO_BOX (source_combo_box), NULL);
+       g_return_val_if_fail (E_IS_SOURCE_COMBO_BOX (combo_box), NULL);
 
-       return source_combo_box->priv->source_list;
+       return combo_box->priv->source_list;
 }
 
 /**
  * e_source_combo_box_set_source_list:
- * @source_combo_box: an #ESourceComboBox
+ * @combo_box: an #ESourceComboBox
  * @source_list: an #ESourceList
  *
  * Sets the source list used by @source_combo_box to be @source_list.  This
@@ -378,44 +378,44 @@ e_source_combo_box_get_source_list (ESourceComboBox *source_combo_box)
  * Since: 2.22
  **/
 void
-e_source_combo_box_set_source_list (ESourceComboBox *source_combo_box,
+e_source_combo_box_set_source_list (ESourceComboBox *combo_box,
                                     ESourceList *source_list)
 {
-       g_return_if_fail (E_IS_SOURCE_COMBO_BOX (source_combo_box));
+       g_return_if_fail (E_IS_SOURCE_COMBO_BOX (combo_box));
 
        if (source_list != NULL) {
                g_return_if_fail (E_IS_SOURCE_LIST (source_list));
                g_object_ref (source_list);
        }
 
-       if (source_combo_box->priv->source_list != NULL) {
+       if (combo_box->priv->source_list != NULL) {
                g_signal_handler_disconnect (
-                       source_combo_box->priv->source_list,
-                       source_combo_box->priv->handler_id);
-               g_object_unref (source_combo_box->priv->source_list);
-               source_combo_box->priv->handler_id = 0;
+                       combo_box->priv->source_list,
+                       combo_box->priv->handler_id);
+               g_object_unref (combo_box->priv->source_list);
+               combo_box->priv->handler_id = 0;
        }
 
-       source_combo_box->priv->source_list = source_list;
+       combo_box->priv->source_list = source_list;
 
        /* Reset the tree store. */
-       source_list_changed_cb (source_list, source_combo_box);
+       source_list_changed_cb (source_list, combo_box);
 
        /* Watch for source list changes. */
        if (source_list != NULL) {
-               source_combo_box->priv->handler_id =
+               combo_box->priv->handler_id =
                        g_signal_connect_object (
                                source_list, "changed",
                                G_CALLBACK (source_list_changed_cb),
-                               source_combo_box, 0);
+                               combo_box, 0);
        }
 
-       g_object_notify (G_OBJECT (source_combo_box), "source-list");
+       g_object_notify (G_OBJECT (combo_box), "source-list");
 }
 
 /**
  * e_source_combo_box_get_active:
- * @source_combo_box: an #ESourceComboBox
+ * @combo_box: an #ESourceComboBox
  *
  * Returns the #ESource corresponding to the currently active item, or %NULL
  * if there is no active item.
@@ -425,21 +425,21 @@ e_source_combo_box_set_source_list (ESourceComboBox *source_combo_box,
  * Since: 2.22
  **/
 ESource *
-e_source_combo_box_get_active (ESourceComboBox *source_combo_box)
+e_source_combo_box_get_active (ESourceComboBox *combo_box)
 {
-       GtkComboBox *combo_box;
+       GtkComboBox *gtk_combo_box;
        GtkTreeIter iter;
        ESource *source;
 
-       g_return_val_if_fail (E_IS_SOURCE_COMBO_BOX (source_combo_box), NULL);
+       g_return_val_if_fail (E_IS_SOURCE_COMBO_BOX (combo_box), NULL);
 
-       combo_box = GTK_COMBO_BOX (source_combo_box);
+       gtk_combo_box = GTK_COMBO_BOX (combo_box);
 
-       if (!gtk_combo_box_get_active_iter (combo_box, &iter))
+       if (!gtk_combo_box_get_active_iter (gtk_combo_box, &iter))
                return NULL;
 
        gtk_tree_model_get (
-               gtk_combo_box_get_model (combo_box),
+               gtk_combo_box_get_model (gtk_combo_box),
                &iter, COLUMN_SOURCE, &source, -1);
 
        return source;
@@ -447,7 +447,7 @@ e_source_combo_box_get_active (ESourceComboBox *source_combo_box)
 
 /**
  * e_source_combo_box_set_active:
- * @source_combo_box: an #ESourceComboBox
+ * @combo_box: an #ESourceComboBox
  * @source: an #ESource
  *
  * Sets the active item to the one corresponding to @source.
@@ -455,19 +455,19 @@ e_source_combo_box_get_active (ESourceComboBox *source_combo_box)
  * Since: 2.22
  **/
 void
-e_source_combo_box_set_active (ESourceComboBox *source_combo_box,
+e_source_combo_box_set_active (ESourceComboBox *combo_box,
                                ESource *source)
 {
-       g_return_if_fail (E_IS_SOURCE_COMBO_BOX (source_combo_box));
+       g_return_if_fail (E_IS_SOURCE_COMBO_BOX (combo_box));
        g_return_if_fail (E_IS_SOURCE (source));
 
        e_source_combo_box_set_active_uid (
-               source_combo_box, e_source_peek_uid (source));
+               combo_box, e_source_peek_uid (source));
 }
 
 /**
  * e_source_combo_box_get_active_uid:
- * @source_combo_box: an #ESourceComboBox
+ * @combo_box: an #ESourceComboBox
  *
  * Returns the unique ID of the #ESource corresponding to the currently
  * active item, or %NULL if there is no active item.
@@ -477,13 +477,13 @@ e_source_combo_box_set_active (ESourceComboBox *source_combo_box,
  * Since: 2.22
  **/
 const gchar *
-e_source_combo_box_get_active_uid (ESourceComboBox *source_combo_box)
+e_source_combo_box_get_active_uid (ESourceComboBox *combo_box)
 {
        ESource *source;
 
-       g_return_val_if_fail (E_IS_SOURCE_COMBO_BOX (source_combo_box), NULL);
+       g_return_val_if_fail (E_IS_SOURCE_COMBO_BOX (combo_box), NULL);
 
-       source = e_source_combo_box_get_active (source_combo_box);
+       source = e_source_combo_box_get_active (combo_box);
        if (source == NULL)
                return NULL;
 
@@ -492,7 +492,7 @@ e_source_combo_box_get_active_uid (ESourceComboBox *source_combo_box)
 
 /**
  * e_source_combo_box_set_active_uid:
- * @source_combo_box: an #ESourceComboBox
+ * @combo_box: an #ESourceComboBox
  * @uid: a unique ID of an #ESource
  *
  * Sets the active item to the one corresponding to @uid.
@@ -502,20 +502,20 @@ e_source_combo_box_get_active_uid (ESourceComboBox *source_combo_box)
  * Since: 2.22
  **/
 gboolean
-e_source_combo_box_set_active_uid (ESourceComboBox *source_combo_box,
+e_source_combo_box_set_active_uid (ESourceComboBox *combo_box,
                                    const gchar *uid)
 {
        ESourceComboBoxPrivate *priv;
        GtkTreeRowReference *reference;
-       GtkComboBox *combo_box;
+       GtkComboBox *gtk_combo_box;
        GtkTreeIter iter;
        gboolean iter_was_set;
 
-       g_return_val_if_fail (E_IS_SOURCE_COMBO_BOX (source_combo_box), FALSE);
+       g_return_val_if_fail (E_IS_SOURCE_COMBO_BOX (combo_box), FALSE);
        g_return_val_if_fail (uid != NULL, FALSE);
 
-       priv = source_combo_box->priv;
-       combo_box = GTK_COMBO_BOX (source_combo_box);
+       priv = combo_box->priv;
+       gtk_combo_box = GTK_COMBO_BOX (combo_box);
 
        reference = g_hash_table_lookup (priv->uid_index, uid);
        if (!reference)
@@ -524,11 +524,11 @@ e_source_combo_box_set_active_uid (ESourceComboBox *source_combo_box,
        g_return_val_if_fail (gtk_tree_row_reference_valid (reference), FALSE);
 
        iter_was_set = gtk_tree_model_get_iter (
-               gtk_combo_box_get_model (combo_box), &iter,
+               gtk_combo_box_get_model (gtk_combo_box), &iter,
                gtk_tree_row_reference_get_path (reference));
        g_return_val_if_fail (iter_was_set, FALSE);
 
-       gtk_combo_box_set_active_iter (combo_box, &iter);
+       gtk_combo_box_set_active_iter (gtk_combo_box, &iter);
 
        return TRUE;
 }
index a4413a8..193732b 100644 (file)
@@ -63,19 +63,19 @@ struct _ESourceComboBoxClass {
 GType          e_source_combo_box_get_type     (void);
 GtkWidget *    e_source_combo_box_new          (ESourceList *source_list);
 ESourceList *  e_source_combo_box_get_source_list
-                                               (ESourceComboBox *source_combo_box);
+                                               (ESourceComboBox *combo_box);
 void           e_source_combo_box_set_source_list
-                                               (ESourceComboBox *source_combo_box,
+                                               (ESourceComboBox *combo_box,
                                                 ESourceList *source_list);
 ESource *      e_source_combo_box_get_active
-                                               (ESourceComboBox *source_combo_box);
+                                               (ESourceComboBox *combo_box);
 void           e_source_combo_box_set_active
-                                               (ESourceComboBox *source_combo_box,
+                                               (ESourceComboBox *combo_box,
                                                 ESource *source);
 const gchar *  e_source_combo_box_get_active_uid
-                                               (ESourceComboBox *source_combo_box);
+                                               (ESourceComboBox *combo_box);
 gboolean       e_source_combo_box_set_active_uid
-                                               (ESourceComboBox *source_combo_box,
+                                               (ESourceComboBox *combo_box,
                                                 const gchar *uid);
 
 G_END_DECLS
index 71aef27..73cb79d 100644 (file)
@@ -207,15 +207,16 @@ setup_dialog (GtkWindow *parent, ESourceSelectorDialog *dialog, ESourceList *sou
 
 /**
  * e_source_selector_dialog_new:
- * @parent: Parent window.
- * @source_list: A source list.
+ * @parent: a parent window
+ * @source_list: an #ESourceList
  *
  * Create a new source selector dialog for the given @list.
  *
- * Returns: The newly created widget.
- */
+ * Returns: a new #ESourceSelectorDialog
+ **/
 GtkWidget *
-e_source_selector_dialog_new (GtkWindow *parent, ESourceList *source_list)
+e_source_selector_dialog_new (GtkWindow *parent,
+                              ESourceList *source_list)
 {
        ESourceSelectorDialog *dialog;
 
@@ -228,11 +229,11 @@ e_source_selector_dialog_new (GtkWindow *parent, ESourceList *source_list)
 
 /**
  * e_source_selector_dialog_select_default_source:
- * @dialog: An #ESourceSelectorDialog widget.
+ * @dialog: an #ESourceSelectorDialog
  *
- * Selects default source in the dialog.
+ * Selects the default source in the dialog.
  *
- * Returns: Whether found any default source.
+ * Returns: %TRUE if a default source was selected
  *
  * Since: 2.28
  **/
@@ -276,19 +277,16 @@ e_source_selector_dialog_select_default_source (ESourceSelectorDialog *dialog)
 
 /**
  * e_source_selector_dialog_peek_primary_selection:
- * @dialog: An #ESourceSelectorDialog widget.
+ * @dialog: an #ESourceSelectorDialog
  *
  * Peek the currently selected source in the given @dialog.
  *
- * Returns: the selected ESource.
+ * Returns: the selected #ESource
  */
 ESource *
 e_source_selector_dialog_peek_primary_selection (ESourceSelectorDialog *dialog)
 {
-       ESourceSelectorDialogPrivate *priv;
-
        g_return_val_if_fail (E_IS_SOURCE_SELECTOR_DIALOG (dialog), NULL);
 
-       priv = dialog->priv;
-       return priv->selected_source;
+       return dialog->priv->selected_source;
 }
index b7455a7..66b8cf1 100644 (file)
@@ -25,7 +25,7 @@
 #define E_SOURCE_SELECTOR_DIALOG_H
 
 #include <gtk/gtk.h>
-#include "libedataserver/e-source-list.h"
+#include <libedataserver/e-source-list.h>
 
 /* Standard GObject macros */
 #define E_TYPE_SOURCE_SELECTOR_DIALOG \
index 28b90fd..d8f8333 100644 (file)
@@ -1366,8 +1366,6 @@ e_source_selector_init (ESourceSelector *selector)
        gtk_tree_view_set_headers_visible (tree_view, FALSE);
 }
 
-/* Public API.  */
-
 /**
  * e_source_selector_new:
  * @list: A source list.
index 73a19a2..fb1dc3e 100644 (file)
@@ -25,7 +25,7 @@
 #define E_SOURCE_SELECTOR_H
 
 #include <gtk/gtk.h>
-#include "libedataserver/e-source-list.h"
+#include <libedataserver/e-source-list.h>
 
 /* Standard GObject macros */
 #define E_TYPE_SOURCE_SELECTOR \
@@ -93,12 +93,15 @@ gboolean    e_source_selector_source_is_selected
                                                (ESourceSelector *selector,
                                                 ESource *source);
 GSList *       e_source_selector_get_selection (ESourceSelector *selector);
-void           e_source_selector_free_selection (GSList *list);
-void           e_source_selector_show_selection (ESourceSelector *selector,
+void           e_source_selector_free_selection
+                                               (GSList *list);
+void           e_source_selector_show_selection
+                                               (ESourceSelector *selector,
                                                 gboolean show);
 gboolean       e_source_selector_selection_shown
                                                (ESourceSelector *selector);
-void           e_source_selector_set_select_new (ESourceSelector *selector,
+void           e_source_selector_set_select_new
+                                               (ESourceSelector *selector,
                                                 gboolean state);
 void           e_source_selector_edit_primary_selection
                                                (ESourceSelector *selector);