diff options
author | Ettore Perazzoli <ettore@src.gnome.org> | 2001-08-23 05:41:32 +0800 |
---|---|---|
committer | Ettore Perazzoli <ettore@src.gnome.org> | 2001-08-23 05:41:32 +0800 |
commit | bb662dceb3894008854314fed8625402c8af85dd (patch) | |
tree | 331f8f5b46ee931216a81990a329f3753a52b33c /shell/e-storage.c | |
parent | 050cf4e61fd7036aed9f0a17e4599e0203eefb57 (diff) | |
download | gsoc2013-evolution-bb662dceb3894008854314fed8625402c8af85dd.tar.gz 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/e-storage.c')
-rw-r--r-- | shell/e-storage.c | 12 |
1 files changed, 12 insertions, 0 deletions
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"); } |