[evolution-activesync: 2/6] Add some comments



commit 62c13376f9bb9b1fda5d29b305ab4bbd36222bd3
Author: Oliver Luo <lyc pku eecs gmail com>
Date:   Thu Jul 16 16:02:50 2015 +0800

    Add some comments
    
    Add some comments and delete some useless code.

 collection/e-eas-backend-factory.c        |    4 ++++
 collection/e-eas-backend.c                |   15 ++++-----------
 collection/module-eas-backend.c           |    2 ++
 configuration/e-mail-config-eas-backend.c |   13 +++++++++++++
 configuration/module-eas-mail-config.c    |    2 ++
 5 files changed, 25 insertions(+), 11 deletions(-)
---
diff --git a/collection/e-eas-backend-factory.c b/collection/e-eas-backend-factory.c
index 262a886..5088684 100644
--- a/collection/e-eas-backend-factory.c
+++ b/collection/e-eas-backend-factory.c
@@ -1,5 +1,8 @@
 /*
  * e-eas-backend-factory.c
+ * The collection backend runs in the registry service. It's just a necessary
+ * procedure. You don't have to change it unless you really have things to do
+ * during the registry.
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -70,6 +73,7 @@ eas_backend_factory_prepare_mail (ECollectionBackendFactory *factory,
                mail_identity_source,
                mail_transport_source);
 
+       /* Do our own job here. */
        eas_backend_prepare_mail_account_source (mail_account_source);
        eas_backend_prepare_mail_transport_source (mail_transport_source);
 }
diff --git a/collection/e-eas-backend.c b/collection/e-eas-backend.c
index 5486981..59e4a15 100644
--- a/collection/e-eas-backend.c
+++ b/collection/e-eas-backend.c
@@ -1,5 +1,8 @@
 /*
  * e-eas-backend.c
+ * The collection backend runs in the registry service. It's just a necessary
+ * procedure. You don't have to change it unless you really have things to do
+ * during the registry.
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -23,8 +26,6 @@
 
 #include "e-eas-backend.h"
 
-#include <glib/gi18n-lib.h>
-
 #define E_EAS_BACKEND_GET_PRIVATE(obj) \
        (G_TYPE_INSTANCE_GET_PRIVATE \
        ((obj), E_TYPE_EAS_BACKEND, EEasBackendPrivate))
@@ -34,9 +35,6 @@ typedef struct _SyncFoldersClosure SyncFoldersClosure;
 struct _EEasBackendPrivate {
        /* Folder ID -> ESource */
        GHashTable *folders;
-
-       gchar *sync_state;
-       GMutex sync_state_lock;
 };
 
 struct _SyncFoldersClosure {
@@ -73,10 +71,7 @@ eas_backend_finalize (GObject *object)
        
        g_hash_table_destroy (priv->folders);
 
-       g_free (priv->sync_state);
-       g_mutex_clear (&priv->sync_state_lock);
-
-       /* Chain up to parent's finalize() method */
+       /* Chain up to parent's finalize() method. */
        G_OBJECT_CLASS (e_eas_backend_parent_class)->finalize (object);
 }
 
@@ -109,8 +104,6 @@ e_eas_backend_init (EEasBackend *backend)
                (GEqualFunc) g_str_equal,
                (GDestroyNotify) g_free,
                (GDestroyNotify) g_object_unref);
-
-       g_mutex_init (&backend->priv->sync_state_lock);
 }
 
 void
diff --git a/collection/module-eas-backend.c b/collection/module-eas-backend.c
index c524e06..716a1be 100644
--- a/collection/module-eas-backend.c
+++ b/collection/module-eas-backend.c
@@ -1,5 +1,6 @@
 /*
  * module-eas-backend.c
+ * The modules loading work.
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -28,6 +29,7 @@
 void e_module_load (GTypeModule *type_module);
 void e_module_unload (GTypeModule *type_module);
 
+/* Load our modules here. */
 G_MODULE_EXPORT void
 e_module_load (GTypeModule *type_module)
 {
diff --git a/configuration/e-mail-config-eas-backend.c b/configuration/e-mail-config-eas-backend.c
index 5602e85..46e897b 100644
--- a/configuration/e-mail-config-eas-backend.c
+++ b/configuration/e-mail-config-eas-backend.c
@@ -1,5 +1,6 @@
 /*
  * e-mail-config-eas-backend.c
+ * The configuration UI runs in Evolution.
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -33,6 +34,7 @@
 #include <mail/e-mail-config-auth-check.h>
 #include <mail/e-mail-config-receiving-page.h>
 
+/* To use camel_eas_settings_set_account_uid() */
 #include "libevoeas/camel-eas-settings.h"
 
 #define E_MAIL_CONFIG_EAS_BACKEND_GET_PRIVATE(obj) \
@@ -79,6 +81,7 @@ mail_config_eas_backend_new_collection (EMailConfigServiceBackend *backend)
        return source;
 }
 
+/* Server URL auto discover button handler */
 static void
 discover_server_url (GtkWidget *button, EMailConfigServiceBackend *backend)
 {
@@ -109,6 +112,7 @@ discover_server_url (GtkWidget *button, EMailConfigServiceBackend *backend)
                        username = NULL;
                }
 
+               /* Core server URL auto discover handler */
                eas_mail_handler_autodiscover(
                        handler,
                        email_address,
@@ -125,6 +129,7 @@ discover_server_url (GtkWidget *button, EMailConfigServiceBackend *backend)
        }
 }
 
+/* Construct the Receiving Email page. */
 static void
 mail_config_eas_backend_insert_widgets (EMailConfigServiceBackend *backend,
                                         GtkBox *parent)
@@ -156,6 +161,7 @@ mail_config_eas_backend_insert_widgets (EMailConfigServiceBackend *backend,
         * introduce a backend extension in the mail transport source. */
        settings = e_mail_config_service_backend_get_settings (backend);
 
+       /* Add widget. */
        text = _("Configuration");
        markup = g_markup_printf_escaped ("<b>%s</b>", text);
        widget = gtk_label_new (markup);
@@ -227,10 +233,12 @@ mail_config_eas_backend_insert_widgets (EMailConfigServiceBackend *backend,
        priv->autodiscover_button = widget;
        gtk_widget_show (widget);
 
+       /* Connect auto discover button to it's handler with information needed. */
        g_object_set_data ((GObject *)widget, "username-entry", (gpointer)priv->user_entry);
        g_object_set_data ((GObject *)widget, "url-entry", (gpointer)priv->host_entry);
        g_signal_connect (widget, "clicked", G_CALLBACK(discover_server_url), backend);
 
+       /* Bind property in priv with widget to automatically read the input. */
        g_object_bind_property (
                settings, "user",
                priv->user_entry, "text",
@@ -263,6 +271,8 @@ mail_config_eas_backend_insert_widgets (EMailConfigServiceBackend *backend,
                G_BINDING_SYNC_CREATE);
 }
 
+/* Setup default value in the Receiving page using the information Stored 
+ * in GConf. */
 static void
 mail_config_eas_backend_setup_defaults (EMailConfigServiceBackend *backend)
 {
@@ -298,6 +308,7 @@ mail_config_eas_backend_setup_defaults (EMailConfigServiceBackend *backend)
                username = gconf_client_get_string (client, key, NULL);
                g_free (key);
 
+               /* The default username is the same as the email address. */
                if (username == NULL || *username == '\0') {
                        username = g_strdup (email_address);
                }
@@ -317,6 +328,7 @@ mail_config_eas_backend_setup_defaults (EMailConfigServiceBackend *backend)
        }
 }
 
+/* Check whether the information is enough to complete current step. */
 static gboolean
 mail_config_eas_backend_check_complete (EMailConfigServiceBackend *backend)
 {
@@ -353,6 +365,7 @@ mail_config_eas_backend_check_complete (EMailConfigServiceBackend *backend)
        return TRUE;
 }
 
+/* Save the filled information to GConf and move on. */
 static void
 mail_config_eas_backend_commit_changes (EMailConfigServiceBackend *backend)
 {
diff --git a/configuration/module-eas-mail-config.c b/configuration/module-eas-mail-config.c
index b527dae..16acaae 100644
--- a/configuration/module-eas-mail-config.c
+++ b/configuration/module-eas-mail-config.c
@@ -1,5 +1,6 @@
 /*
  * module-eas-mail-config.c
+ * The modules loading work.
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -27,6 +28,7 @@
 void e_module_load (GTypeModule *type_module);
 void e_module_unload (GTypeModule *type_module);
 
+/* Load our modules here. */
 G_MODULE_EXPORT void
 e_module_load (GTypeModule *type_module)
 {


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