[evolution-ews/wip/tests: 2/4] Define and use set_server_version



commit 71cb3356df1d0583d9f3e62fa7f771acbd0c724c
Author: Fabiano Fidêncio <fidencio redhat com>
Date:   Mon Sep 30 14:02:36 2013 +0200

    Define and use set_server_version

 src/server/e-ews-connection.c |   31 +++++++++++++++++++------------
 src/server/e-ews-connection.h |    3 +++
 2 files changed, 22 insertions(+), 12 deletions(-)
---
diff --git a/src/server/e-ews-connection.c b/src/server/e-ews-connection.c
index 4e2e71a..ac66fdd 100644
--- a/src/server/e-ews-connection.c
+++ b/src/server/e-ews-connection.c
@@ -404,18 +404,7 @@ ews_discover_server_version (EEwsConnection *cnc,
 
        version = e_soap_parameter_get_property (param, "Version");
 
-       if (g_strcmp0 (version, "Exchange2007") == 0)
-               cnc->priv->version = E_EWS_EXCHANGE_2007;
-       else if (g_strcmp0 (version, "Exchange2007_SP1") == 0)
-               cnc->priv->version = E_EWS_EXCHANGE_2007_SP1;
-       else if (g_strcmp0 (version, "Exchange2010") == 0)
-               cnc->priv->version = E_EWS_EXCHANGE_2010;
-       else if (g_strcmp0 (version, "Exchange2010_SP1") == 0)
-               cnc->priv->version = E_EWS_EXCHANGE_2010_SP1;
-       else if (g_strcmp0 (version, "Exchange2010_SP2") == 0)
-               cnc->priv->version = E_EWS_EXCHANGE_2010_SP2;
-       else
-               cnc->priv->version = E_EWS_EXCHANGE_FUTURE;
+       e_ews_connection_set_server_version (cnc, version);
 
        g_free (version);
 }
@@ -3879,6 +3868,24 @@ e_ews_connection_get_server_version (EEwsConnection *cnc)
        return cnc->priv->version;
 }
 
+void
+e_ews_connection_set_server_version (EEwsConnection *cnc,
+                                    const gchar *version)
+{
+       if (g_strcmp0 (version, "Exchange2007") == 0)
+               cnc->priv->version = E_EWS_EXCHANGE_2007;
+       else if (g_strcmp0 (version, "Exchange2007_SP1") == 0)
+               cnc->priv->version = E_EWS_EXCHANGE_2007_SP1;
+       else if (g_strcmp0 (version, "Exchange2010") == 0)
+               cnc->priv->version = E_EWS_EXCHANGE_2010;
+       else if (g_strcmp0 (version, "Exchange2010_SP1") == 0)
+               cnc->priv->version = E_EWS_EXCHANGE_2010_SP1;
+       else if (g_strcmp0 (version, "Exchange2010_SP2") == 0)
+               cnc->priv->version = E_EWS_EXCHANGE_2010_SP2;
+       else
+               cnc->priv->version = E_EWS_EXCHANGE_FUTURE;
+}
+
 gboolean
 e_ews_connection_satisfies_server_version (EEwsConnection *cnc,
                                          EEwsServerVersion version)
diff --git a/src/server/e-ews-connection.h b/src/server/e-ews-connection.h
index 6bc987c..9f43dbf 100644
--- a/src/server/e-ews-connection.h
+++ b/src/server/e-ews-connection.h
@@ -336,6 +336,9 @@ gboolean    e_ews_connection_find_folder_items_sync
 EEwsServerVersion
                e_ews_connection_get_server_version
                                                (EEwsConnection *cnc);
+void           e_ews_connection_set_server_version
+                                               (EEwsConnection *cnc,
+                                                const gchar *version);
 gboolean       e_ews_connection_satisfies_server_version
                                                (EEwsConnection *cnc,
                                                 EEwsServerVersion versio);


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