[evolution-kolab/account-mgmt] Remove KOLAB_SETTINGS_HANDLER_CHAR_FIELD_KOLAB_SERVER_NAME.
- From: Matthew Barnes <mbarnes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-kolab/account-mgmt] Remove KOLAB_SETTINGS_HANDLER_CHAR_FIELD_KOLAB_SERVER_NAME.
- Date: Mon, 2 Jul 2012 14:05:24 +0000 (UTC)
commit b0497e2183cf818d9acca2e1a6943b105f96e4bd
Author: Matthew Barnes <mbarnes redhat com>
Date: Mon Jul 2 10:04:10 2012 -0400
Remove KOLAB_SETTINGS_HANDLER_CHAR_FIELD_KOLAB_SERVER_NAME.
Use CamelNetworkSettings:host instead.
src/addressbook/e-book-backend-kolab.c | 2 -
src/calendar/e-cal-backend-kolab.c | 2 -
src/libekolab/kolab-settings-handler.c | 2 -
src/libekolab/kolab-settings-handler.h | 1 -
src/libekolab/kolab-util-backend.c | 39 +++++---------------
src/libekolab/kolab-util-backend.h | 2 +-
.../integration/libekolab/test-kolab-mail-access.c | 15 ++------
7 files changed, 13 insertions(+), 50 deletions(-)
---
diff --git a/src/addressbook/e-book-backend-kolab.c b/src/addressbook/e-book-backend-kolab.c
index 29cee01..2cb2b85 100644
--- a/src/addressbook/e-book-backend-kolab.c
+++ b/src/addressbook/e-book-backend-kolab.c
@@ -301,7 +301,6 @@ e_book_backend_kolab_open (EBookBackendSync *backend,
kolab_util_backend_prepare_settings (ksettings,
NULL,
NULL,
- NULL,
foldername,
&sync_value);
/* We may find that we do not yet have a password set.
@@ -352,7 +351,6 @@ e_book_backend_kolab_open (EBookBackendSync *backend,
kolab_util_backend_prepare_settings (ksettings,
esource,
- servername,
NULL,
foldername,
&sync_value);
diff --git a/src/calendar/e-cal-backend-kolab.c b/src/calendar/e-cal-backend-kolab.c
index a96645b..e9acd09 100644
--- a/src/calendar/e-cal-backend-kolab.c
+++ b/src/calendar/e-cal-backend-kolab.c
@@ -361,7 +361,6 @@ e_cal_backend_kolab_open (ECalBackendSync *backend,
kolab_util_backend_prepare_settings (ksettings,
NULL,
NULL,
- NULL,
foldername,
&sync_value);
/* We may find that we do not yet have a password set.
@@ -412,7 +411,6 @@ e_cal_backend_kolab_open (ECalBackendSync *backend,
kolab_util_backend_prepare_settings (ksettings,
esource,
- servername,
NULL,
foldername,
&sync_value);
diff --git a/src/libekolab/kolab-settings-handler.c b/src/libekolab/kolab-settings-handler.c
index c13f839..79d0b3d 100644
--- a/src/libekolab/kolab-settings-handler.c
+++ b/src/libekolab/kolab-settings-handler.c
@@ -87,7 +87,6 @@ static KolabSettingsHandlerGetFunc _kolab_settings_handler_char_get_funcs[] = {
kolab_settings_handler_char_get_func_camel_config_dir, /* KOLAB_SETTINGS_HANDLER_CHAR_FIELD_CAMEL_CONFIG_DIR */
NULL, /* KOLAB_SETTINGS_HANDLER_CHAR_FIELD_CAMEL_ACCOUNT_DIR */
NULL, /* KOLAB_SETTINGS_HANDLER_CHAR_FIELD_ESOURCE_UID */
- NULL, /* KOLAB_SETTINGS_HANDLER_CHAR_FIELD_KOLAB_SERVER_NAME */
NULL, /* KOLAB_SETTINGS_HANDLER_CHAR_FIELD_KOLAB_USER_PASSWORD */
NULL /* KOLAB_SETTINGS_HANDLER_CHAR_FIELD_PKCS11_USER_PIN */
};
@@ -98,7 +97,6 @@ static KolabSettingsHandlerCharSetFunc _kolab_settings_handler_char_set_funcs[]
kolab_settings_handler_char_set_func_camel_config_dir, /* KOLAB_SETTINGS_HANDLER_CHAR_FIELD_CAMEL_CONFIG_DIR */
NULL, /* KOLAB_SETTINGS_HANDLER_CHAR_FIELD_CAMEL_ACCOUNT_DIR */
NULL, /* KOLAB_SETTINGS_HANDLER_CHAR_FIELD_ESOURCE_UID */
- NULL, /* KOLAB_SETTINGS_HANDLER_CHAR_FIELD_KOLAB_SERVER_NAME */
NULL, /* KOLAB_SETTINGS_HANDLER_CHAR_FIELD_KOLAB_USER_PASSWORD */
NULL /* KOLAB_SETTINGS_HANDLER_CHAR_FIELD_PKCS11_USER_PIN */
};
diff --git a/src/libekolab/kolab-settings-handler.h b/src/libekolab/kolab-settings-handler.h
index a6c8471..92c70dc 100644
--- a/src/libekolab/kolab-settings-handler.h
+++ b/src/libekolab/kolab-settings-handler.h
@@ -126,7 +126,6 @@ typedef enum {
KOLAB_SETTINGS_HANDLER_CHAR_FIELD_CAMEL_CONFIG_DIR,
KOLAB_SETTINGS_HANDLER_CHAR_FIELD_CAMEL_ACCOUNT_DIR,
KOLAB_SETTINGS_HANDLER_CHAR_FIELD_ESOURCE_UID,
- KOLAB_SETTINGS_HANDLER_CHAR_FIELD_KOLAB_SERVER_NAME,
KOLAB_SETTINGS_HANDLER_CHAR_FIELD_KOLAB_USER_NAME,
KOLAB_SETTINGS_HANDLER_CHAR_FIELD_KOLAB_USER_PASSWORD,
KOLAB_SETTINGS_HANDLER_CHAR_FIELD_PKCS11_USER_PIN,
diff --git a/src/libekolab/kolab-util-backend.c b/src/libekolab/kolab-util-backend.c
index 0d055da..5058b28 100644
--- a/src/libekolab/kolab-util-backend.c
+++ b/src/libekolab/kolab-util-backend.c
@@ -249,9 +249,9 @@ kolab_util_backend_koma_table_cleanup_cb (gpointer data,
{
KolabMailAccess *koma = KOLAB_MAIL_ACCESS (object);
GHashTable *koma_table = (GHashTable *) data;
- const gchar *servername = NULL;
+ const gchar *host = NULL;
const gchar *user = NULL;
- gchar *user_at_server = NULL;
+ gchar *user_at_host = NULL;
KolabSettingsHandler *ksettings = NULL;
CamelKolabIMAPXSettings *camel_settings;
CamelNetworkSettings *network_settings;
@@ -266,15 +266,13 @@ kolab_util_backend_koma_table_cleanup_cb (gpointer data,
camel_settings = kolab_settings_handler_get_camel_settings (ksettings);
network_settings = CAMEL_NETWORK_SETTINGS (camel_settings);
+ host = camel_network_settings_get_host (network_settings);
user = camel_network_settings_get_user (network_settings);
- servername = kolab_settings_handler_get_char_field (ksettings,
- KOLAB_SETTINGS_HANDLER_CHAR_FIELD_KOLAB_SERVER_NAME,
- NULL);
- user_at_server = g_strdup_printf ("%s %s", user, servername);
- (void)g_hash_table_remove (koma_table, user_at_server);
+ user_at_host = g_strdup_printf ("%s %s", user, host);
+ (void)g_hash_table_remove (koma_table, user_at_host);
- g_free (user_at_server);
+ g_free (user_at_host);
g_object_remove_toggle_ref (object,
kolab_util_backend_koma_table_cleanup_cb,
data);
@@ -311,7 +309,6 @@ kolab_util_backend_modtime_set_on_ecalcomp (ECalComponent *ecalcomp)
void
kolab_util_backend_prepare_settings (KolabSettingsHandler *ksettings,
ESource *esource,
- const gchar *servername,
const gchar *password,
const gchar *sourcename,
const KolabSyncStrategyID *sync_value)
@@ -355,17 +352,6 @@ kolab_util_backend_prepare_settings (KolabSettingsHandler *ksettings,
error = NULL;
}
}
- if (servername != NULL) {
- (void)kolab_settings_handler_set_char_field (ksettings,
- KOLAB_SETTINGS_HANDLER_CHAR_FIELD_KOLAB_SERVER_NAME,
- g_strdup (servername),
- &error);
- if (error != NULL) {
- g_warning ("%s()[%u] error: %s", __func__, __LINE__, error->message);
- g_error_free (error);
- error = NULL;
- }
- }
if (password != NULL) {
(void)kolab_settings_handler_set_char_field (ksettings,
KOLAB_SETTINGS_HANDLER_CHAR_FIELD_KOLAB_USER_PASSWORD,
@@ -458,8 +444,8 @@ kolab_util_backend_account_uid_new_from_settings (KolabSettingsHandler *ksetting
{
CamelKolabIMAPXSettings *camel_settings;
CamelNetworkSettings *network_settings;
+ const gchar *host = NULL;
const gchar *user = NULL;
- const gchar *server = NULL;
const gchar *esource_uid = NULL;
gchar *account_uid = NULL;
gchar *tmp_str = NULL;
@@ -487,17 +473,10 @@ kolab_util_backend_account_uid_new_from_settings (KolabSettingsHandler *ksetting
camel_settings = kolab_settings_handler_get_camel_settings (ksettings);
network_settings = CAMEL_NETWORK_SETTINGS (camel_settings);
+ host = camel_network_settings_get_host (network_settings);
user = camel_network_settings_get_user (network_settings);
- server = kolab_settings_handler_get_char_field (ksettings,
- KOLAB_SETTINGS_HANDLER_CHAR_FIELD_KOLAB_SERVER_NAME,
- &tmp_err);
- if (tmp_err != NULL) {
- g_propagate_error (err, tmp_err);
- return NULL;
- }
-
- tmp_str = g_strconcat (user, "@", server, NULL);
+ tmp_str = g_strconcat (user, "@", host, NULL);
done:
diff --git a/src/libekolab/kolab-util-backend.h b/src/libekolab/kolab-util-backend.h
index 6af4a71..e216702 100644
--- a/src/libekolab/kolab-util-backend.h
+++ b/src/libekolab/kolab-util-backend.h
@@ -85,7 +85,7 @@ void kolab_util_backend_koma_table_cleanup_cb (gpointer data, GObject *object, g
void kolab_util_backend_modtime_set_on_econtact (EContact *econtact);
void kolab_util_backend_modtime_set_on_ecalcomp (ECalComponent *ecalcomp);
-void kolab_util_backend_prepare_settings (KolabSettingsHandler *ksettings, ESource *esource, const gchar *servername, const gchar *password, const gchar *sourcename, const KolabSyncStrategyID *sync_value);
+void kolab_util_backend_prepare_settings (KolabSettingsHandler *ksettings, ESource *esource, const gchar *password, const gchar *sourcename, const KolabSyncStrategyID *sync_value);
gboolean kolab_util_backend_sqlite_db_new_open (KolabUtilSqliteDb **kdb, KolabSettingsHandler *ksettings, const gchar *dbfilename, GError **err);
diff --git a/src/tests/integration/libekolab/test-kolab-mail-access.c b/src/tests/integration/libekolab/test-kolab-mail-access.c
index 0b231d8..90affa7 100644
--- a/src/tests/integration/libekolab/test-kolab-mail-access.c
+++ b/src/tests/integration/libekolab/test-kolab-mail-access.c
@@ -103,14 +103,9 @@ kolab_itest_koma_ksettings_envset (KolabSettingsHandler *ksettings,
g_assert (pkcs11pin != NULL);
g_assert (security < CAMEL_NETWORK_SECURITY_METHOD_STARTTLS_ON_STANDARD_PORT);
- ok = kolab_settings_handler_set_char_field (ksettings,
- KOLAB_SETTINGS_HANDLER_CHAR_FIELD_KOLAB_SERVER_NAME,
- servername,
- &tmp_err);
- if (! ok) {
- g_propagate_error (err, tmp_err);
- return FALSE;
- }
+ camel_network_settings_set_user (network_settings, username);
+ camel_network_settings_set_host (network_settings, servername);
+ camel_network_settings_set_security_method (network_settings, security);
ok = kolab_settings_handler_set_int_field (ksettings,
KOLAB_SETTINGS_HANDLER_INT_FIELD_KOLAB_SERVER_IMAP_PORT,
@@ -121,8 +116,6 @@ kolab_itest_koma_ksettings_envset (KolabSettingsHandler *ksettings,
return FALSE;
}
- camel_network_settings_set_user (network_settings, username);
-
ok = kolab_settings_handler_set_char_field (ksettings,
KOLAB_SETTINGS_HANDLER_CHAR_FIELD_KOLAB_USER_PASSWORD,
userpass,
@@ -141,8 +134,6 @@ kolab_itest_koma_ksettings_envset (KolabSettingsHandler *ksettings,
return FALSE;
}
- camel_network_settings_set_security_method (network_settings, security);
-
return TRUE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]