[evolution-data-server] CamelIMAPXServer: A little code reorganization.



commit 217c07c74ad6a8c3f3ac81edc70aeb069c88b648
Author: Matthew Barnes <mbarnes redhat com>
Date:   Fri Jan 17 15:06:40 2014 -0500

    CamelIMAPXServer: A little code reorganization.

 camel/providers/imapx/camel-imapx-server.c |   92 ++++++++++++++--------------
 1 files changed, 46 insertions(+), 46 deletions(-)
---
diff --git a/camel/providers/imapx/camel-imapx-server.c b/camel/providers/imapx/camel-imapx-server.c
index ae6b010..aa99934 100644
--- a/camel/providers/imapx/camel-imapx-server.c
+++ b/camel/providers/imapx/camel-imapx-server.c
@@ -791,6 +791,52 @@ imapx_uidset_add (struct _uidset_state *ss,
        return 0;
 }
 
+static gboolean
+imapx_register_job (CamelIMAPXServer *is,
+                    CamelIMAPXJob *job,
+                    GError **error)
+{
+       if (is->state >= IMAPX_INITIALISED) {
+               QUEUE_LOCK (is);
+               g_queue_push_head (&is->jobs, camel_imapx_job_ref (job));
+               QUEUE_UNLOCK (is);
+
+       } else {
+               e (is->tagprefix, "NO connection yet, maybe user cancelled jobs earlier ?");
+               g_set_error (
+                       error, CAMEL_SERVICE_ERROR,
+                       CAMEL_SERVICE_ERROR_NOT_CONNECTED,
+                       _("Not authenticated"));
+               return FALSE;
+       }
+
+       return TRUE;
+}
+
+static void
+imapx_unregister_job (CamelIMAPXServer *is,
+                      CamelIMAPXJob *job)
+{
+       if (!job->noreply)
+               camel_imapx_job_done (job);
+
+       QUEUE_LOCK (is);
+       if (g_queue_remove (&is->jobs, job))
+               camel_imapx_job_unref (job);
+       QUEUE_UNLOCK (is);
+}
+
+static gboolean
+imapx_submit_job (CamelIMAPXServer *is,
+                  CamelIMAPXJob *job,
+                  GError **error)
+{
+       if (!imapx_register_job (is, job, error))
+               return FALSE;
+
+       return camel_imapx_job_run (job, is, error);
+}
+
 static CamelFolder *
 imapx_server_ref_folder (CamelIMAPXServer *is,
                          CamelIMAPXMailbox *mailbox)
@@ -3390,52 +3436,6 @@ imapx_command_run_sync (CamelIMAPXServer *is,
        return success;
 }
 
-static gboolean
-imapx_register_job (CamelIMAPXServer *is,
-                    CamelIMAPXJob *job,
-                    GError **error)
-{
-       if (is->state >= IMAPX_INITIALISED) {
-               QUEUE_LOCK (is);
-               g_queue_push_head (&is->jobs, camel_imapx_job_ref (job));
-               QUEUE_UNLOCK (is);
-
-       } else {
-               e (is->tagprefix, "NO connection yet, maybe user cancelled jobs earlier ?");
-               g_set_error (
-                       error, CAMEL_SERVICE_ERROR,
-                       CAMEL_SERVICE_ERROR_NOT_CONNECTED,
-                       _("Not authenticated"));
-               return FALSE;
-       }
-
-       return TRUE;
-}
-
-static void
-imapx_unregister_job (CamelIMAPXServer *is,
-                      CamelIMAPXJob *job)
-{
-       if (!job->noreply)
-               camel_imapx_job_done (job);
-
-       QUEUE_LOCK (is);
-       if (g_queue_remove (&is->jobs, job))
-               camel_imapx_job_unref (job);
-       QUEUE_UNLOCK (is);
-}
-
-static gboolean
-imapx_submit_job (CamelIMAPXServer *is,
-                  CamelIMAPXJob *job,
-                  GError **error)
-{
-       if (!imapx_register_job (is, job, error))
-               return FALSE;
-
-       return camel_imapx_job_run (job, is, error);
-}
-
 /* ********************************************************************** */
 // IDLE support
 


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