diff options
author | Ettore Perazzoli <ettore@src.gnome.org> | 2001-10-10 22:10:51 +0800 |
---|---|---|
committer | Ettore Perazzoli <ettore@src.gnome.org> | 2001-10-10 22:10:51 +0800 |
commit | acaea79e7129ea2b3eb289a9ea3b2644ac970fba (patch) | |
tree | e26bd8236f44477a152761e602d7b3740f4e6694 /shell/e-storage-set-view.c | |
parent | 6b746897bf30dcf96db4c404dce56c30ecc0c16e (diff) | |
download | gsoc2013-evolution-acaea79e7129ea2b3eb289a9ea3b2644ac970fba.tar gsoc2013-evolution-acaea79e7129ea2b3eb289a9ea3b2644ac970fba.tar.gz gsoc2013-evolution-acaea79e7129ea2b3eb289a9ea3b2644ac970fba.tar.bz2 gsoc2013-evolution-acaea79e7129ea2b3eb289a9ea3b2644ac970fba.tar.lz gsoc2013-evolution-acaea79e7129ea2b3eb289a9ea3b2644ac970fba.tar.xz gsoc2013-evolution-acaea79e7129ea2b3eb289a9ea3b2644ac970fba.tar.zst gsoc2013-evolution-acaea79e7129ea2b3eb289a9ea3b2644ac970fba.zip |
Make this a no-op if the source and the destination path are the same.
* e-storage.c (e_storage_async_xfer_folder): Make this a no-op if
the source and the destination path are the same.
* e-local-storage.c (impl_async_xfer_folder): return after
returning `E_STORAGE_CANTCHANGESTOCKFOLDER' to the callback.
* e-storage-set-view.c (handle_evolution_path_drag_motion): Make
the check for dragging a folder over itself a little bit more
accurate.
svn path=/trunk/; revision=13550
Diffstat (limited to 'shell/e-storage-set-view.c')
-rw-r--r-- | shell/e-storage-set-view.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/shell/e-storage-set-view.c b/shell/e-storage-set-view.c index 5e2e2284a0..230f65b598 100644 --- a/shell/e-storage-set-view.c +++ b/shell/e-storage-set-view.c @@ -1014,17 +1014,28 @@ handle_evolution_path_drag_motion (EStorageSetView *storage_set_view, if (source_widget != NULL && E_IS_STORAGE_SET_VIEW (storage_set_view)) { const char *source_path; - source_path = e_storage_set_view_get_current_folder (storage_set_view); + source_path = e_storage_set_view_get_current_folder (storage_set_view); if (source_path != NULL) { int source_path_len; - const char *destination_path; + const char *destination_path_base; + char *destination_path; source_path_len = strlen (path); - destination_path = e_tree_memory_node_get_data (E_TREE_MEMORY (priv->etree_model), path); + destination_path_base = e_tree_memory_node_get_data (E_TREE_MEMORY (priv->etree_model), path); + if (strcmp (destination_path_base, source_path) == 0) + return FALSE; + + destination_path = g_strconcat (destination_path_base, "/", g_basename (source_path), NULL); - if (strncmp (destination_path, source_path, source_path_len) == 0) + g_print ("source %s destination %s\n", source_path, destination_path); + + if (strncmp (destination_path, source_path, source_path_len) == 0) { + g_free (destination_path); return FALSE; + } + + g_free (destination_path); } } } |