aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2004-02-05 04:24:45 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2004-02-05 04:24:45 +0800
commitfcb6b0d8c35a49e94bfbbaaeffc929f88705efe3 (patch)
treed5297950d3a13c1e7512250dc298e98179ddd6ce
parent7907f9183d846f4e15a38b4dfcbdb8bc0fa7ed68 (diff)
downloadgsoc2013-evolution-fcb6b0d8c35a49e94bfbbaaeffc929f88705efe3.tar
gsoc2013-evolution-fcb6b0d8c35a49e94bfbbaaeffc929f88705efe3.tar.gz
gsoc2013-evolution-fcb6b0d8c35a49e94bfbbaaeffc929f88705efe3.tar.bz2
gsoc2013-evolution-fcb6b0d8c35a49e94bfbbaaeffc929f88705efe3.tar.lz
gsoc2013-evolution-fcb6b0d8c35a49e94bfbbaaeffc929f88705efe3.tar.xz
gsoc2013-evolution-fcb6b0d8c35a49e94bfbbaaeffc929f88705efe3.tar.zst
gsoc2013-evolution-fcb6b0d8c35a49e94bfbbaaeffc929f88705efe3.zip
Fix for bug #53755 (local folders case)
2004-02-04 Jeffrey Stedfast <fejj@ximian.com> Fix for bug #53755 (local folders case) * providers/local/camel-mbox-store.c (xrename): No longer takes an exception arg, we just set errno. Our caller can take care of setting an exception. (rename_folder): Don't pass an exception to xrename(), we always overwrote if an error occured it anyway. (rename_folder): Rename the .sbd as well. svn path=/trunk/; revision=24616
-rw-r--r--camel/ChangeLog11
-rw-r--r--camel/camel-store.c2
-rw-r--r--camel/providers/local/camel-mbox-store.c29
3 files changed, 28 insertions, 14 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index a1e214ab4d..2a05f97bdc 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,3 +1,14 @@
+2004-02-04 Jeffrey Stedfast <fejj@ximian.com>
+
+ Fix for bug #53755 (local folders case)
+
+ * providers/local/camel-mbox-store.c (xrename): No longer takes an
+ exception arg, we just set errno. Our caller can take care of
+ setting an exception.
+ (rename_folder): Don't pass an exception to xrename(), we always
+ overwrote if an error occured it anyway.
+ (rename_folder): Rename the .sbd as well.
+
2004-02-04 Not Zed <NotZed@Ximian.com>
* camel-store.c (camel_store_sync): added 'expunge' parameter,
diff --git a/camel/camel-store.c b/camel/camel-store.c
index 8afd13d225..556d8daf52 100644
--- a/camel/camel-store.c
+++ b/camel/camel-store.c
@@ -462,7 +462,7 @@ camel_store_rename_folder (CamelStore *store, const char *old_namein, const char
camel_object_unref(folder);
}
- /* Emit changed signal */
+ /* Emit renamed signal */
if (store->flags & CAMEL_STORE_SUBSCRIPTIONS)
flags |= CAMEL_STORE_FOLDER_INFO_SUBSCRIBED;
diff --git a/camel/providers/local/camel-mbox-store.c b/camel/providers/local/camel-mbox-store.c
index 74bf94579f..6308c700fe 100644
--- a/camel/providers/local/camel-mbox-store.c
+++ b/camel/providers/local/camel-mbox-store.c
@@ -385,7 +385,7 @@ create_folder (CamelStore *store, const char *parent_name, const char *folder_na
}
static int
-xrename (CamelStore *store, const char *old_name, const char *new_name, const char *ext, gboolean missingok, CamelException *ex)
+xrename (CamelStore *store, const char *old_name, const char *new_name, const char *ext, gboolean missingok)
{
const char *toplevel_dir = ((CamelLocalStore *) store)->toplevel_dir;
char *oldpath, *newpath;
@@ -430,12 +430,6 @@ xrename (CamelStore *store, const char *old_name, const char *new_name, const ch
ret = -1;
}
- if (ret == -1) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not rename %s to %s: %s"),
- oldpath, newpath, g_strerror (err));
- }
-
g_free (oldpath);
g_free (newpath);
@@ -446,7 +440,7 @@ static void
rename_folder (CamelStore *store, const char *old, const char *new, CamelException *ex)
{
CamelLocalFolder *folder = NULL;
- char *oldibex, *newibex, *newdir;
+ char *oldibex, *newibex, *newdir, *sbd;
int errnosav;
if (new[0] == '.' || ignore_file (new, TRUE)) {
@@ -491,12 +485,17 @@ rename_folder (CamelStore *store, const char *old, const char *new, CamelExcepti
}
}
- if (xrename (store, old, new, ".ev-summary", TRUE, ex) == -1) {
+ if (xrename (store, old, new, ".ev-summary", TRUE) == -1) {
errnosav = errno;
goto summary_failed;
}
- if (xrename (store, old, new, NULL, FALSE, ex) == -1) {
+ if (xrename (store, old, new, ".sbd", TRUE) == -1) {
+ errnosav = errno;
+ goto subdir_failed;
+ }
+
+ if (xrename (store, old, new, NULL, FALSE) == -1) {
errnosav = errno;
goto base_failed;
}
@@ -511,7 +510,11 @@ rename_folder (CamelStore *store, const char *old, const char *new, CamelExcepti
base_failed:
- xrename (store, new, old, ".ev-summary", TRUE, ex);
+ xrename (store, new, old, ".ev-summary", TRUE);
+
+ subdir_failed:
+
+ xrename (store, new, old, ".sbd", TRUE);
summary_failed:
@@ -530,8 +533,8 @@ rename_folder (CamelStore *store, const char *old, const char *new, CamelExcepti
}
camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not rename '%s': %s"),
- old, g_strerror (errnosav));
+ _("Could not rename '%s' to %s: %s"),
+ old, new, g_strerror (errnosav));
g_free (newibex);
g_free (oldibex);