diff options
-rw-r--r-- | shell/ChangeLog | 9 | ||||
-rw-r--r-- | shell/e-storage.c | 12 | ||||
-rw-r--r-- | shell/e-storage.h | 1 |
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; |