[evolution-exchange] Adapt to CamelNetworkSettings changes.
- From: Matthew Barnes <mbarnes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-exchange] Adapt to CamelNetworkSettings changes.
- Date: Mon, 24 Oct 2011 17:13:50 +0000 (UTC)
commit a2b98948b67f7e08a2d8aec03303842d8f987147
Author: Matthew Barnes <mbarnes redhat com>
Date: Thu Oct 20 22:47:27 2011 -0400
Adapt to CamelNetworkSettings changes.
camel/camel-exchange-store.c | 21 ++++++---
camel/camel-exchange-utils.c | 17 ++++++-
server/lib/camel-exchange-settings.c | 80 ++++++++++++++++++++++++++++++++++
3 files changed, 108 insertions(+), 10 deletions(-)
---
diff --git a/camel/camel-exchange-store.c b/camel/camel-exchange-store.c
index b49ad24..23d99fe 100644
--- a/camel/camel-exchange-store.c
+++ b/camel/camel-exchange-store.c
@@ -304,9 +304,11 @@ exchange_store_constructed (GObject *object)
service = CAMEL_SERVICE (object);
eex_migrate_to_user_cache_dir (service);
- url = camel_service_get_camel_url (service);
+ url = camel_service_new_camel_url (service);
exch->base_url = camel_url_to_string (url, CAMEL_URL_HIDE_ALL);
+ camel_url_free (url);
+
/* Strip path */
p = strstr (exch->base_url, "//");
if (p) {
@@ -320,18 +322,23 @@ static gchar *
exchange_store_get_name (CamelService *service,
gboolean brief)
{
- CamelURL *url;
+ CamelNetworkSettings *network_settings;
+ CamelSettings *settings;
+ const gchar *host;
+ const gchar *user;
+
+ settings = camel_service_get_settings (service);
- url = camel_service_get_camel_url (service);
+ network_settings = CAMEL_NETWORK_SETTINGS (settings);
+ host = camel_network_settings_get_host (network_settings);
+ user = camel_network_settings_get_user (network_settings);
if (brief) {
return g_strdup_printf (
- _("Exchange server %s"),
- url->host);
+ _("Exchange server %s"), host);
} else {
return g_strdup_printf (
- _("Exchange account for %s on %s"),
- url->user, url->host);
+ _("Exchange account for %s on %s"), user, host);
}
}
diff --git a/camel/camel-exchange-utils.c b/camel/camel-exchange-utils.c
index fa7fb4f..dd26354 100644
--- a/camel/camel-exchange-utils.c
+++ b/camel/camel-exchange-utils.c
@@ -122,17 +122,25 @@ is_same_ed (CamelExchangeStore *estore,
if (CAMEL_IS_EXCHANGE_STORE (service) && estore && estore == CAMEL_EXCHANGE_STORE (service))
return TRUE;
- service_url = camel_service_get_camel_url (service);
+ service_url = camel_service_new_camel_url (service);
if (service_url) {
CamelURL *estore_url = NULL;
+ gboolean url_equal = FALSE;
if (estore != NULL)
- estore_url = camel_service_get_camel_url (
+ estore_url = camel_service_new_camel_url (
CAMEL_SERVICE (estore));
- if (estore_url != NULL && camel_url_equal (estore_url, service_url))
+ if (estore_url != NULL) {
+ url_equal = camel_url_equal (estore_url, service_url);
+ camel_url_free (estore_url);
+ }
+
+ if (url_equal) {
+ camel_url_free (service_url);
return TRUE;
+ }
if (eaccount) {
EAccount *account = exchange_account_fetch (eaccount);
@@ -146,6 +154,7 @@ is_same_ed (CamelExchangeStore *estore,
if ((provider && provider->url_equal && provider->url_equal (url, service_url))
|| camel_url_equal (url, service_url)) {
+ camel_url_free (service_url);
camel_url_free (url);
return TRUE;
}
@@ -154,6 +163,8 @@ is_same_ed (CamelExchangeStore *estore,
}
}
}
+
+ camel_url_free (service_url);
}
return FALSE;
diff --git a/server/lib/camel-exchange-settings.c b/server/lib/camel-exchange-settings.c
index 201128e..3d6b0f9 100644
--- a/server/lib/camel-exchange-settings.c
+++ b/server/lib/camel-exchange-settings.c
@@ -53,6 +53,7 @@ struct _CamelExchangeSettingsPrivate {
enum {
PROP_0,
+ PROP_AUTH_MECHANISM,
PROP_CHECK_ALL,
PROP_FILTER_JUNK,
PROP_FILTER_JUNK_INBOX,
@@ -61,11 +62,14 @@ enum {
PROP_GC_EXPAND_GROUPS,
PROP_GC_RESULTS_LIMIT,
PROP_GC_SERVER_NAME,
+ PROP_HOST,
PROP_MAILBOX,
PROP_OWA_PATH,
PROP_OWA_URL,
PROP_PASSWD_EXP_WARN_PERIOD,
+ PROP_PORT,
PROP_SECURITY_METHOD,
+ PROP_USER,
PROP_USE_GC_RESULTS_LIMIT,
PROP_USE_PASSWD_EXP_WARN_PERIOD
};
@@ -84,6 +88,12 @@ exchange_settings_set_property (GObject *object,
GParamSpec *pspec)
{
switch (property_id) {
+ case PROP_AUTH_MECHANISM:
+ camel_network_settings_set_auth_mechanism (
+ CAMEL_NETWORK_SETTINGS (object),
+ g_value_get_string (value));
+ return;
+
case PROP_CHECK_ALL:
camel_exchange_settings_set_check_all (
CAMEL_EXCHANGE_SETTINGS (object),
@@ -132,6 +142,12 @@ exchange_settings_set_property (GObject *object,
g_value_get_string (value));
return;
+ case PROP_HOST:
+ camel_network_settings_set_host (
+ CAMEL_NETWORK_SETTINGS (object),
+ g_value_get_string (value));
+ return;
+
case PROP_MAILBOX:
camel_exchange_settings_set_mailbox (
CAMEL_EXCHANGE_SETTINGS (object),
@@ -156,12 +172,24 @@ exchange_settings_set_property (GObject *object,
g_value_get_uint (value));
return;
+ case PROP_PORT:
+ camel_network_settings_set_port (
+ CAMEL_NETWORK_SETTINGS (object),
+ g_value_get_uint (value));
+ return;
+
case PROP_SECURITY_METHOD:
camel_network_settings_set_security_method (
CAMEL_NETWORK_SETTINGS (object),
g_value_get_enum (value));
return;
+ case PROP_USER:
+ camel_network_settings_set_user (
+ CAMEL_NETWORK_SETTINGS (object),
+ g_value_get_string (value));
+ return;
+
case PROP_USE_GC_RESULTS_LIMIT:
camel_exchange_settings_set_use_gc_results_limit (
CAMEL_EXCHANGE_SETTINGS (object),
@@ -185,6 +213,13 @@ exchange_settings_get_property (GObject *object,
GParamSpec *pspec)
{
switch (property_id) {
+ case PROP_AUTH_MECHANISM:
+ g_value_set_string (
+ value,
+ camel_network_settings_get_auth_mechanism (
+ CAMEL_NETWORK_SETTINGS (object)));
+ return;
+
case PROP_CHECK_ALL:
g_value_set_boolean (
value,
@@ -241,6 +276,13 @@ exchange_settings_get_property (GObject *object,
CAMEL_EXCHANGE_SETTINGS (object)));
return;
+ case PROP_HOST:
+ g_value_set_string (
+ value,
+ camel_network_settings_get_host (
+ CAMEL_NETWORK_SETTINGS (object)));
+ return;
+
case PROP_MAILBOX:
g_value_set_string (
value,
@@ -269,6 +311,13 @@ exchange_settings_get_property (GObject *object,
CAMEL_EXCHANGE_SETTINGS (object)));
return;
+ case PROP_PORT:
+ g_value_set_uint (
+ value,
+ camel_network_settings_get_port (
+ CAMEL_NETWORK_SETTINGS (object)));
+ return;
+
case PROP_SECURITY_METHOD:
g_value_set_enum (
value,
@@ -276,6 +325,13 @@ exchange_settings_get_property (GObject *object,
CAMEL_NETWORK_SETTINGS (object)));
return;
+ case PROP_USER:
+ g_value_set_string (
+ value,
+ camel_network_settings_get_user (
+ CAMEL_NETWORK_SETTINGS (object)));
+ return;
+
case PROP_USE_GC_RESULTS_LIMIT:
g_value_set_boolean (
value,
@@ -322,6 +378,12 @@ camel_exchange_settings_class_init (CamelExchangeSettingsClass *class)
object_class->get_property = exchange_settings_get_property;
object_class->finalize = exchange_settings_finalize;
+ /* Inherited from CamelNetworkSettings. */
+ g_object_class_override_property (
+ object_class,
+ PROP_AUTH_MECHANISM,
+ "auth-mechanism");
+
g_object_class_install_property (
object_class,
PROP_CHECK_ALL,
@@ -421,6 +483,12 @@ camel_exchange_settings_class_init (CamelExchangeSettingsClass *class)
G_PARAM_CONSTRUCT |
G_PARAM_STATIC_STRINGS));
+ /* Inherited from CamelNetworkSettings. */
+ g_object_class_override_property (
+ object_class,
+ PROP_HOST,
+ "host");
+
g_object_class_install_property (
object_class,
PROP_MAILBOX,
@@ -474,9 +542,21 @@ camel_exchange_settings_class_init (CamelExchangeSettingsClass *class)
/* Inherited from CamelNetworkSettings. */
g_object_class_override_property (
object_class,
+ PROP_PORT,
+ "port");
+
+ /* Inherited from CamelNetworkSettings. */
+ g_object_class_override_property (
+ object_class,
PROP_SECURITY_METHOD,
"security-method");
+ /* Inherited from CamelNetworkSettings. */
+ g_object_class_override_property (
+ object_class,
+ PROP_USER,
+ "user");
+
g_object_class_install_property (
object_class,
PROP_USE_GC_RESULTS_LIMIT,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]