[evolution-kolab/ek-wip-xfb: 4/8] src: consistently use the KOLAB_PATH_SEPARATOR(_S) defs
- From: Christian Hilberg <chilberg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-kolab/ek-wip-xfb: 4/8] src: consistently use the KOLAB_PATH_SEPARATOR(_S) defs
- Date: Tue, 23 Oct 2012 11:07:29 +0000 (UTC)
commit 344261dd52e1f6931112e9d746a96d2f9e5d7852
Author: Christian Hilberg <hilberg kernelconcepts de>
Date: Tue Oct 23 10:55:25 2012 +0200
src: consistently use the KOLAB_PATH_SEPARATOR(_S) defs
src/collection/e-kolab-backend.c | 4 +---
src/libekolab/kolab-mail-imap-client.c | 26 ++++++++++++++------------
src/libekolab/kolab-util-backend.c | 5 +++--
src/libekolabconv/test/src/email-parser.c | 6 ++++--
4 files changed, 22 insertions(+), 19 deletions(-)
---
diff --git a/src/collection/e-kolab-backend.c b/src/collection/e-kolab-backend.c
index 88304b9..c078c82 100644
--- a/src/collection/e-kolab-backend.c
+++ b/src/collection/e-kolab-backend.c
@@ -23,6 +23,7 @@
#include <libekolab/camel-kolab-imapx-settings.h>
#include <libekolabutil/kolab-util-camel.h>
+#include <libekolabutil/kolab-util.h>
#define E_KOLAB_BACKEND_GET_PRIVATE(obj) \
(G_TYPE_INSTANCE_GET_PRIVATE \
@@ -34,9 +35,6 @@
#define REGISTER_TYPE(type) \
(g_type_class_unref (g_type_class_ref (type)))
-#define KOLAB_PATH_SEPARATOR '/'
-#define KOLAB_PATH_SEPARATOR_S "/"
-
struct _EKolabBackendPrivate {
KolabMailAccess *koma;
GMutex koma_lock;
diff --git a/src/libekolab/kolab-mail-imap-client.c b/src/libekolab/kolab-mail-imap-client.c
index ccdb2ff..a97a26e 100644
--- a/src/libekolab/kolab-mail-imap-client.c
+++ b/src/libekolab/kolab-mail-imap-client.c
@@ -35,6 +35,7 @@
#include <libekolabutil/kolab-util-glib.h>
#include <libekolabutil/kolab-util-error.h>
#include <libekolabutil/kolab-util-camel.h>
+#include <libekolabutil/kolab-util.h>
#include "camel-kolab-session.h"
#include "camel-kolab-imapx-store.h"
@@ -678,7 +679,7 @@ mail_imap_client_query_foldernames (KolabMailImapClient *self,
} else {
folder_list = kolab_util_camel_folderlist_from_folderinfo (fi);
}
-
+
camel_store_free_folder_info (CAMEL_STORE (priv->store), fi);
return folder_list;
@@ -756,13 +757,14 @@ mail_imap_client_store (KolabMailImapClient *self,
/* split foldername into parent_name and folder_name
* (we get full path here)
*/
- path = kolab_util_camel_imap_path_split (foldername, "/"); /* FIXME get delimiter from store */
+ path = kolab_util_camel_imap_path_split (foldername,
+ KOLAB_PATH_SEPARATOR_S); /* FIXME get delimiter from store */
if (path == NULL) {
g_warning ("%s()[%u]: KolabUtilCamelIMAPPath instance for path '%s' is NULL. This should never happen.",
__func__, __LINE__, foldername);
goto cleanup;
}
-
+
fi = camel_store_create_folder_sync (CAMEL_STORE (priv->store),
path->parent_name,
path->folder_name,
@@ -788,10 +790,10 @@ mail_imap_client_store (KolabMailImapClient *self,
__func__, __LINE__);
ok = TRUE;
}
-
+
if (tmp_err != NULL)
goto cleanup;
-
+
goto cleanup;
}
@@ -1404,7 +1406,7 @@ kolab_mail_imap_client_get_password (KolabMailImapClient *self)
{
KolabMailImapClientPrivate *priv = NULL;
const gchar *passwd = NULL;
-
+
g_assert (KOLAB_IS_MAIL_IMAP_CLIENT (self));
priv = KOLAB_MAIL_IMAP_CLIENT_PRIVATE (self);
@@ -1416,7 +1418,7 @@ kolab_mail_imap_client_get_password (KolabMailImapClient *self)
* Camel for the (X)FB triggers only, which are not sent unless
* we went online, so no trouble to be expected here.
*/
-
+
g_return_val_if_fail (priv->store != NULL, NULL);
passwd = camel_service_get_password (CAMEL_SERVICE (priv->store));
@@ -1540,7 +1542,7 @@ kolab_mail_imap_client_query_folder_info_online (KolabMailImapClient *self,
g_warning ("%s()[%u]: NULL folder descriptor for folder '%s', type '%u'",
__func__, __LINE__, foldername, type_id);
}
-
+
folder_names_ptr = g_list_next (folder_names_ptr);
}
@@ -1738,13 +1740,13 @@ kolab_mail_imap_client_delete_folder (KolabMailImapClient *self,
if (has_children)
goto folder_skip;
-
+
folder = camel_store_get_folder_sync (CAMEL_STORE (priv->store),
foldername,
0,
cancellable,
&tmp_err);
-
+
if (tmp_err != NULL)
goto exit;
@@ -1757,7 +1759,7 @@ kolab_mail_imap_client_delete_folder (KolabMailImapClient *self,
has_messages = (camel_folder_get_message_count (folder) > 0);
folder_skip:
-
+
/* won't delete a folder which has subfolders or messages in it */
if (has_children || has_messages) {
g_set_error (&tmp_err,
@@ -1784,7 +1786,7 @@ kolab_mail_imap_client_delete_folder (KolabMailImapClient *self,
if (folder)
g_object_unref (folder);
-
+
return ok;
}
diff --git a/src/libekolab/kolab-util-backend.c b/src/libekolab/kolab-util-backend.c
index a5c140b..5ff77ad 100644
--- a/src/libekolab/kolab-util-backend.c
+++ b/src/libekolab/kolab-util-backend.c
@@ -36,6 +36,7 @@
#include <libekolabutil/camel-system-headers.h>
#include <libekolabutil/kolab-util-camel.h>
+#include <libekolabutil/kolab-util.h>
#include "e-source-kolab-folder.h"
#include "kolab-mail-access.h"
@@ -126,7 +127,7 @@ kolab_util_backend_get_relative_path_from_uri (const gchar *uri)
}
tmp = g_strdup (c_url->path);
camel_url_free (c_url);
- if (tmp[0] == '/') {
+ if (tmp[0] == KOLAB_PATH_SEPARATOR) {
path = g_strdup (tmp+1);
g_free (tmp);
}
@@ -535,7 +536,7 @@ kolab_util_backend_deploy_mode_by_backend (KolabMailAccess *koma,
if (online)
koma_mode = KOLAB_MAIL_ACCESS_OPMODE_ONLINE;
-
+
tmp_mode = kolab_util_backend_deploy_mode_by_koma (koma,
koma_mode,
cancellable,
diff --git a/src/libekolabconv/test/src/email-parser.c b/src/libekolabconv/test/src/email-parser.c
index ac239a5..853f9e2 100644
--- a/src/libekolabconv/test/src/email-parser.c
+++ b/src/libekolabconv/test/src/email-parser.c
@@ -28,6 +28,8 @@
#define _XOPEN_SOURCE
#define _POSIX_SOURCE
+#include <libekolabutil/kolab-util.h>
+
#include <stdio.h>
#include <unistd.h>
#include <logging.h>
@@ -194,7 +196,7 @@ add_klb_mail_list_to_g_mime_message (GMimeMessage *message, const GList* klb_mai
Kolab_conv_mail_part *klb_mail_part = ((Kolab_conv_mail_part*) iterator->data);
- gchar **tokens = g_strsplit (klb_mail_part->mime_type, "/", -1);
+ gchar **tokens = g_strsplit (klb_mail_part->mime_type, KOLAB_PATH_SEPARATOR_S, -1);
mime_part = g_mime_part_new_with_type (tokens[0], tokens[1]);
@@ -386,7 +388,7 @@ read_kolab_email_file(const gchar *filename, GError** error) {
if( file_buf ){
klb_mail_part = g_new0(Kolab_conv_mail_part , 1);
strcpy (contentType, g_mime_obj->content_type->type);
- strcat (contentType, "/");
+ strcat (contentType, KOLAB_PATH_SEPARATOR_S);
strcat (contentType, g_mime_obj->content_type->subtype);
if(fileName)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]