[evolution-kolab/ek-wip-porting] kolab-util-backend: build fixes, cleanup
- From: Christian Hilberg <chilberg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-kolab/ek-wip-porting] kolab-util-backend: build fixes, cleanup
- Date: Thu, 8 Dec 2011 14:19:54 +0000 (UTC)
commit 2f730a42eade151f7d0867d59b3e80286ddc9a4f
Author: Christian Hilberg <hilberg kernelconcepts de>
Date: Thu Dec 8 15:07:57 2011 +0100
kolab-util-backend: build fixes, cleanup
* commented out kolab_util_backend_get_relative_path_from_uri()
(to be re-implemented if needed)
* code formatting
* include camel-system-headers.h from libekolabutil
instead of single Camel headers (which is now disallowed)
src/libekolab/kolab-util-backend.c | 89 +++++++++++++++++++++++++++--------
1 files changed, 68 insertions(+), 21 deletions(-)
---
diff --git a/src/libekolab/kolab-util-backend.c b/src/libekolab/kolab-util-backend.c
index cdf56ac..de6eec0 100644
--- a/src/libekolab/kolab-util-backend.c
+++ b/src/libekolab/kolab-util-backend.c
@@ -25,17 +25,17 @@
/*----------------------------------------------------------------------------*/
-#include "kolab-types.h"
-#include "kolab-util-backend.h"
-#include "kolab-mail-access.h"
-
-#include <camel/camel-url.h>
-#include <camel/camel-exception.h>
#include <string.h>
#include <time.h>
#include <libical/ical.h>
#include <libedataserver/e-source.h>
+#include <libekolabutil/camel-system-headers.h>
+
+#include "kolab-types.h"
+#include "kolab-util-backend.h"
+#include "kolab-mail-access.h"
+
#include "kolab-util-backend.h"
const gchar *kolab_sync_strategy_desc[KOLAB_SYNC_LAST_STRATEGY] = {
@@ -114,6 +114,11 @@ kolab_util_backend_foldername_new_from_sourcename (const gchar *sourcename,
gchar *
kolab_util_backend_get_relative_path_from_uri (const gchar *uri)
{
+ (void)uri;
+ /* FIXME implement me */
+ g_error ("%s: FIXME implement me", __func__);
+ return NULL;
+#if 0
CamelURL *c_url = NULL;
CamelException *cex = NULL;
gchar *tmp = NULL;
@@ -138,6 +143,7 @@ kolab_util_backend_get_relative_path_from_uri (const gchar *uri)
}
return path;
+#endif
} /* kolab_util_backend_get_relative_path_from_uri () */
static gint
@@ -168,19 +174,31 @@ kolab_util_misc_generic_integer_from_property (const gchar *prop_str,
KolabSyncStrategyID
kolab_util_misc_sync_value_from_property (const gchar *sync_prop)
{
- return kolab_util_misc_generic_integer_from_property (sync_prop, KOLAB_SYNC_STRATEGY_DEFAULT);
+ KolabSyncStrategyID sid = KOLAB_SYNC_STRATEGY_DEFAULT;
+ g_assert (sync_prop != NULL);
+ sid = kolab_util_misc_generic_integer_from_property (sync_prop,
+ KOLAB_SYNC_STRATEGY_DEFAULT);
+ return sid;
} /* kolab_util_misc_sync_value_from_property () */
KolabTLSVariantID
kolab_util_misc_tls_variant_from_property (const gchar *tls_variant)
{
- return kolab_util_misc_generic_integer_from_property (tls_variant, KOLAB_TLS_VARIANT_DEFAULT);
+ KolabTLSVariantID tvid = KOLAB_TLS_VARIANT_DEFAULT;
+ g_assert (tls_variant != NULL);
+ tvid = kolab_util_misc_generic_integer_from_property (tls_variant,
+ KOLAB_TLS_VARIANT_DEFAULT);
+ return tvid;
} /* kolab_util_misc_tls_variant_from_property () */
KolabReqPkcs11
kolab_util_misc_req_pkcs11_from_property (const gchar *req_pkcs11_prop)
{
- return kolab_util_misc_generic_integer_from_property (req_pkcs11_prop, KOLAB_PKCS11_INFRASTRUCTURE_DEFAULT);
+ KolabReqPkcs11 pkreq = KOLAB_PKCS11_INFRASTRUCTURE_DEFAULT;
+ g_assert (req_pkcs11_prop != NULL);
+ pkreq = kolab_util_misc_generic_integer_from_property (req_pkcs11_prop,
+ KOLAB_PKCS11_INFRASTRUCTURE_DEFAULT);
+ return pkreq;
}
void
@@ -194,20 +212,27 @@ kolab_util_backend_koma_table_cleanup_cb (gpointer data,
const gchar *username = NULL;
gchar *user_at_server = NULL;
KolabSettingsHandler *ksettings = NULL;
- gboolean ok;
+ /* gboolean ok; */
g_debug ("%s()[%u] called.", __func__, __LINE__);
+ g_assert (data != NULL);
g_assert (G_IS_OBJECT (object));
(void)is_last_ref;
ksettings = kolab_mail_access_get_settings_handler (koma);
- servername = kolab_settings_handler_get_char_field (ksettings, KOLAB_SETTINGS_HANDLER_CHAR_FIELD_KOLAB_SERVER_NAME, NULL);
- username = kolab_settings_handler_get_char_field (ksettings, KOLAB_SETTINGS_HANDLER_CHAR_FIELD_KOLAB_USER_NAME, NULL);
+ servername = kolab_settings_handler_get_char_field (ksettings,
+ KOLAB_SETTINGS_HANDLER_CHAR_FIELD_KOLAB_SERVER_NAME,
+ NULL);
+ username = kolab_settings_handler_get_char_field (ksettings,
+ KOLAB_SETTINGS_HANDLER_CHAR_FIELD_KOLAB_USER_NAME,
+ NULL);
user_at_server = g_strdup_printf ("%s %s", username, servername);
- ok = g_hash_table_remove (koma_table, user_at_server);
+ (void)g_hash_table_remove (koma_table, user_at_server);
g_free (user_at_server);
- g_object_remove_toggle_ref (object, kolab_util_backend_koma_table_cleanup_cb, data);
+ g_object_remove_toggle_ref (object,
+ kolab_util_backend_koma_table_cleanup_cb,
+ data);
} /* kolab_util_backend_koma_table_cleanup_cb () */
void
@@ -259,7 +284,10 @@ kolab_util_backend_prepare_settings (KolabSettingsHandler *ksettings,
g_debug ("%s()[%u] called.", __func__, __LINE__);
if (esource != NULL) {
prop_str = e_source_get_uri (esource);
- (void) kolab_settings_handler_set_char_field (ksettings, KOLAB_SETTINGS_HANDLER_CHAR_FIELD_KOLAB_URI, g_strdup (prop_str), &error);
+ (void)kolab_settings_handler_set_char_field (ksettings,
+ KOLAB_SETTINGS_HANDLER_CHAR_FIELD_KOLAB_URI,
+ g_strdup (prop_str),
+ &error);
if (error != NULL) {
g_warning ("%s()[%u] error: %s", __func__, __LINE__, error->message);
g_error_free (error);
@@ -267,7 +295,10 @@ kolab_util_backend_prepare_settings (KolabSettingsHandler *ksettings,
}
prop_str = e_source_get_property (esource, KOLAB_TLS_VARIANT_PROP);
enc_value = kolab_util_misc_tls_variant_from_property (prop_str);
- (void) kolab_settings_handler_set_uint_field (ksettings, KOLAB_SETTINGS_HANDLER_UINT_FIELD_TLS_VARIANT, enc_value, &error);
+ (void)kolab_settings_handler_set_uint_field (ksettings,
+ KOLAB_SETTINGS_HANDLER_UINT_FIELD_TLS_VARIANT,
+ enc_value,
+ &error);
if (error != NULL) {
g_warning ("%s()[%u] error: %s", __func__, __LINE__, error->message);
g_error_free (error);
@@ -281,7 +312,10 @@ kolab_util_backend_prepare_settings (KolabSettingsHandler *ksettings,
else {
prop_str = NULL;
}
- (void) kolab_settings_handler_set_char_field (ksettings, KOLAB_SETTINGS_HANDLER_CHAR_FIELD_PKCS11_USER_PIN, g_strdup (prop_str), &error);
+ (void)kolab_settings_handler_set_char_field (ksettings,
+ KOLAB_SETTINGS_HANDLER_CHAR_FIELD_PKCS11_USER_PIN,
+ g_strdup (prop_str),
+ &error);
if (error != NULL) {
g_warning ("%s()[%u] error: %s", __func__, __LINE__, error->message);
g_error_free (error);
@@ -289,7 +323,10 @@ kolab_util_backend_prepare_settings (KolabSettingsHandler *ksettings,
}
}
if (servername != NULL) {
- (void) kolab_settings_handler_set_char_field (ksettings, KOLAB_SETTINGS_HANDLER_CHAR_FIELD_KOLAB_SERVER_NAME, g_strdup (servername), &error);
+ (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);
@@ -297,7 +334,10 @@ kolab_util_backend_prepare_settings (KolabSettingsHandler *ksettings,
}
}
if (username != NULL) {
- (void) kolab_settings_handler_set_char_field (ksettings, KOLAB_SETTINGS_HANDLER_CHAR_FIELD_KOLAB_USER_NAME, g_strdup (username), &error);
+ (void)kolab_settings_handler_set_char_field (ksettings,
+ KOLAB_SETTINGS_HANDLER_CHAR_FIELD_KOLAB_USER_NAME,
+ g_strdup (username),
+ &error);
if (error != NULL) {
g_warning ("%s()[%u] error: %s", __func__, __LINE__, error->message);
g_error_free (error);
@@ -305,7 +345,10 @@ kolab_util_backend_prepare_settings (KolabSettingsHandler *ksettings,
}
}
if (password != NULL) {
- (void) kolab_settings_handler_set_char_field (ksettings, KOLAB_SETTINGS_HANDLER_CHAR_FIELD_KOLAB_USER_PASSWORD, g_strdup (password), &error);
+ (void)kolab_settings_handler_set_char_field (ksettings,
+ KOLAB_SETTINGS_HANDLER_CHAR_FIELD_KOLAB_USER_PASSWORD,
+ g_strdup (password),
+ &error);
if (error != NULL) {
g_warning ("%s()[%u] error: %s", __func__, __LINE__, error->message);
g_error_free (error);
@@ -313,7 +356,11 @@ kolab_util_backend_prepare_settings (KolabSettingsHandler *ksettings,
}
}
if (sync_value != NULL) {
- (void) kolab_settings_handler_set_value (ksettings, KOLAB_SETTINGS_HANDLER_TBL_SYNCSTRATEGY, sourcename, GUINT_TO_POINTER (*sync_value), &error);
+ (void)kolab_settings_handler_set_value (ksettings,
+ KOLAB_SETTINGS_HANDLER_TBL_SYNCSTRATEGY,
+ sourcename,
+ GUINT_TO_POINTER (*sync_value),
+ &error);
if (error != NULL) {
g_warning ("%s()[%u] error: %s", __func__, __LINE__, error->message);
g_error_free (error);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]