aboutsummaryrefslogtreecommitdiffstats
path: root/shell
diff options
context:
space:
mode:
authorEttore Perazzoli <ettore@src.gnome.org>2001-08-23 05:41:32 +0800
committerEttore Perazzoli <ettore@src.gnome.org>2001-08-23 05:41:32 +0800
commitbb662dceb3894008854314fed8625402c8af85dd (patch)
tree331f8f5b46ee931216a81990a329f3753a52b33c /shell
parent050cf4e61fd7036aed9f0a17e4599e0203eefb57 (diff)
downloadgsoc2013-evolution-bb662dceb3894008854314fed8625402c8af85dd.tar
gsoc2013-evolution-bb662dceb3894008854314fed8625402c8af85dd.tar.gz
gsoc2013-evolution-bb662dceb3894008854314fed8625402c8af85dd.tar.bz2
gsoc2013-evolution-bb662dceb3894008854314fed8625402c8af85dd.tar.lz
gsoc2013-evolution-bb662dceb3894008854314fed8625402c8af85dd.tar.xz
gsoc2013-evolution-bb662dceb3894008854314fed8625402c8af85dd.tar.zst
gsoc2013-evolution-bb662dceb3894008854314fed8625402c8af85dd.zip
If the remove_source is %TRUE and destination is a descendant of the
* e-storage.c (e_storage_async_xfer_folder): If the remove_source is %TRUE and destination is a descendant of the parent, pass an `E_STORAGE_CANTMOVETODESCENDANT' error code to the callback. * e-storage.h: New value `E_STORAGE_CANTMOVETODESCENDANT' in `EStorageResult'. svn path=/trunk/; revision=12397
Diffstat (limited to 'shell')
-rw-r--r--shell/ChangeLog9
-rw-r--r--shell/e-storage.c12
-rw-r--r--shell/e-storage.h1
3 files changed, 22 insertions, 0 deletions
diff --git a/shell/ChangeLog b/shell/ChangeLog
index 99a746a444..149d021697 100644
--- a/shell/ChangeLog
+++ b/shell/ChangeLog
@@ -1,5 +1,14 @@
2001-08-22 Ettore Perazzoli <ettore@ximian.com>
+ * e-storage.c (e_storage_async_xfer_folder): If the remove_source
+ is %TRUE and destination is a descendant of the parent, pass an
+ `E_STORAGE_CANTMOVETODESCENDANT' error code to the callback.
+
+ * e-storage.h: New value `E_STORAGE_CANTMOVETODESCENDANT' in
+ `EStorageResult'.
+
+2001-08-22 Ettore Perazzoli <ettore@ximian.com>
+
* e-shell-folder-commands.c
(folder_selection_dialog_folder_selected_callback): Actually
return if the folder is being moved into one of its descendants.
diff --git a/shell/e-storage.c b/shell/e-storage.c
index 3ef8041d8a..17c8d94f14 100644
--- a/shell/e-storage.c
+++ b/shell/e-storage.c
@@ -467,6 +467,16 @@ e_storage_async_xfer_folder (EStorage *storage,
g_return_if_fail (destination_path != NULL);
g_return_if_fail (g_path_is_absolute (destination_path));
+ if (remove_source) {
+ int source_len;
+
+ source_len = strlen (source_path);
+ if (strncmp (destination_path, source_path, source_len) == 0) {
+ (* callback) (storage, E_STORAGE_CANTMOVETODESCENDANT, data);
+ return;
+ }
+ }
+
(* ES_CLASS (storage)->async_xfer_folder) (storage, source_path, destination_path, remove_source, callback, data);
}
@@ -499,6 +509,8 @@ e_storage_result_to_string (EStorageResult result)
return _("The specified type is not supported in this storage");
case E_STORAGE_CANTCHANGESTOCKFOLDER:
return _("The specified folder cannot be modified or removed");
+ case E_STORAGE_CANTMOVETODESCENDANT:
+ return _("Cannot make a folder a child of one of its descendants");
default:
return _("Unknown error");
}
diff --git a/shell/e-storage.h b/shell/e-storage.h
index ea3ab52ea1..bc60e1ee5a 100644
--- a/shell/e-storage.h
+++ b/shell/e-storage.h
@@ -58,6 +58,7 @@ enum _EStorageResult {
E_STORAGE_UNSUPPORTEDOPERATION,
E_STORAGE_UNSUPPORTEDTYPE,
E_STORAGE_CANTCHANGESTOCKFOLDER,
+ E_STORAGE_CANTMOVETODESCENDANT,
E_STORAGE_INVALIDNAME
};
typedef enum _EStorageResult EStorageResult;