[evolution-data-server] Bug 633122 - git head 2010-10-25 maildir folders that used to work now don't



commit bce80a4274bffd4d24eed2507425dcb011ed19ac
Author: Chenthill Palanisamy <pchenthill novell com>
Date:   Thu Nov 11 17:48:32 2010 +0530

    Bug 633122 - git head 2010-10-25 maildir folders that used to work now don't

 camel/providers/local/camel-maildir-store.c    |   29 ++++++++++++++++++++---
 docs/reference/libedataserver/tmpl/e-sexp.sgml |    4 +-
 2 files changed, 27 insertions(+), 6 deletions(-)
---
diff --git a/camel/providers/local/camel-maildir-store.c b/camel/providers/local/camel-maildir-store.c
index 0fe4dd9..8ab889e 100644
--- a/camel/providers/local/camel-maildir-store.c
+++ b/camel/providers/local/camel-maildir-store.c
@@ -37,7 +37,7 @@
 #include "camel-maildir-store.h"
 #include "camel-maildir-summary.h"
 
-#define d(x) x
+#define d(x)
 
 G_DEFINE_TYPE (CamelMaildirStore, camel_maildir_store, CAMEL_TYPE_LOCAL_STORE)
 
@@ -93,6 +93,15 @@ maildir_store_create_folder_sync (CamelStore *store,
 		return NULL;
 	}
 
+	if (g_strstr_len (folder_name, -1, ".")) {
+		g_set_error (
+			error, CAMEL_STORE_ERROR,
+			CAMEL_STORE_ERROR_NO_FOLDER,
+			_("Cannot create folder: %s : Folder name cannot contain a dot"), folder_name);
+		return NULL;
+
+	}
+
 	if (parent_name) {
 		gchar *dir_name = maildir_full_name_to_dir_name (parent_name);
 		name = g_strdup_printf("%s/%s.%s", path, dir_name, folder_name);
@@ -528,7 +537,7 @@ scan_dirs (CamelStore *store,
 			short_name++;
 
 		if (strcmp (topfi->full_name, ".") != 0 
-					&& !g_str_has_prefix (topfi->full_name, full_name)) {
+					&& !g_str_has_prefix (full_name, topfi->full_name)) {
 
 			g_free (full_name);
 			continue;
@@ -649,6 +658,15 @@ maildir_store_rename_folder_sync (CamelStore *store,
 		return FALSE;
 	}
 
+	if (g_strstr_len (new, -1, ".")) {
+		g_set_error (
+			error, CAMEL_STORE_ERROR,
+			CAMEL_STORE_ERROR_NO_FOLDER,
+			_("Cannot rename the folder: %s: Folder name cannot contain a dot"), new);
+		return FALSE;
+
+	}
+
 	old_dir = maildir_full_name_to_dir_name (old);
 	new_dir = maildir_full_name_to_dir_name (new);
 
@@ -850,15 +868,18 @@ fail:
 static void
 maildir_rename_old_folder (CamelMaildirStore *mstore, CamelFolderInfo *fi, GCancellable *cancellable, GError **error)
 {
-	gchar *new_name = NULL;
+	gchar *new_name = NULL, *old_name;
 	CamelStoreClass *store_class;
 
-	new_name = maildir_full_name_to_dir_name (fi->full_name);
+	old_name = g_strdup (fi->full_name);
+	g_strdelimit (old_name, ".", '^');
+	new_name = maildir_full_name_to_dir_name (old_name);
 
 	store_class = CAMEL_STORE_CLASS (camel_maildir_store_parent_class);
 	store_class->rename_folder_sync (
 		(CamelStore *)mstore, fi->full_name, new_name, cancellable, error);
 
+	g_free (old_name);
 	g_free (new_name);
 }
 
diff --git a/docs/reference/libedataserver/tmpl/e-sexp.sgml b/docs/reference/libedataserver/tmpl/e-sexp.sgml
index 21fa768..476a1c5 100644
--- a/docs/reference/libedataserver/tmpl/e-sexp.sgml
+++ b/docs/reference/libedataserver/tmpl/e-sexp.sgml
@@ -96,7 +96,7 @@ ESExp
 @Returns: 
 
 
-<!-- ##### FUNCTION e_sexp_ref ##### -->
+<!-- ##### MACRO e_sexp_ref ##### -->
 <para>
 
 </para>
@@ -104,7 +104,7 @@ ESExp
 @f: 
 
 
-<!-- ##### FUNCTION e_sexp_unref ##### -->
+<!-- ##### MACRO e_sexp_unref ##### -->
 <para>
 
 </para>



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