Enlightenment CVS committal
Author : chaos
Project : e17
Module : apps/evfs
Dir : e17/apps/evfs/src/bin
Modified Files:
evfs_main.c evfs_server_handle.c
Log Message:
* Add 'move' operation
===================================================================
RCS file: /cvs/e/e17/apps/evfs/src/bin/evfs_main.c,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -3 -r1.45 -r1.46
--- evfs_main.c 22 Apr 2006 06:50:25 -0000 1.45
+++ evfs_main.c 10 Jun 2006 02:35:58 -0000 1.46
@@ -197,8 +197,11 @@
evfs_handle_file_read_command(client, command);
break;
case EVFS_CMD_FILE_COPY:
- printf("File copy handler\n");
- evfs_handle_file_copy(client, command, command);
+ evfs_handle_file_copy(client, command, command,0);
+ cleanup_command = 0;
+ break;
+ case EVFS_CMD_FILE_MOVE:
+ evfs_handle_file_copy(client, command, command,1);
cleanup_command = 0;
break;
===================================================================
RCS file: /cvs/e/e17/apps/evfs/src/bin/evfs_server_handle.c,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -3 -r1.53 -r1.54
--- evfs_server_handle.c 22 Apr 2006 06:50:25 -0000 1.53
+++ evfs_server_handle.c 10 Jun 2006 02:35:58 -0000 1.54
@@ -388,7 +388,7 @@
*/
void
evfs_handle_file_copy(evfs_client * client, evfs_command * command,
- evfs_command * root_command)
+ evfs_command * root_command, int move)
{
evfs_plugin *plugin;
evfs_plugin *dst_plugin;
@@ -438,6 +438,7 @@
/*Get the source file size */
(*EVFS_PLUGIN_FILE(plugin)->functions->evfs_file_lstat) (command,
&file_stat, 0);
+ /*Get destination file size*/
res =
(*EVFS_PLUGIN_FILE(dst_plugin)->functions->evfs_file_lstat)
(command, &dest_stat, 1);
@@ -450,6 +451,13 @@
evfs_filereference_clone(command->file_command.files[1]),
file_stat, dest_stat, res);
+ /*If we're a move, queue the delete of this dir..*/
+ if (move) {
+ evfs_operation_remove_task_add(EVFS_OPERATION(op),
+
evfs_filereference_clone(command->file_command.files[0]),
+ file_stat);
+ }
+
} else {
Ecore_List *directory_list = NULL;
@@ -492,7 +500,7 @@
//printf("Copy file '%s' to %s\n", file->path,
destination_file);
evfs_handle_file_copy(client, recursive_command,
- root_command);
+ root_command, move);
evfs_cleanup_filereference(file);
evfs_cleanup_command(recursive_command,
@@ -500,20 +508,23 @@
}
ecore_list_destroy(directory_list);
+ /*If we're a move, queue the delete of this dir (it should be
empty - unless perms denied it....*/
+ if (move) {
+ evfs_operation_remove_task_add(EVFS_OPERATION(op),
+
evfs_filereference_clone(command->file_command.files[0]),
+ file_stat);
+ }
+
}
}
- printf("4\n");
-
-
/*Only send '100%' event when we're back at the top, or we aren't
recursive */
if (command == root_command) {
/*evfs_file_progress_event_create(client, command, root_command,
100,
EVFS_PROGRESS_TYPE_DONE);*/
evfs_operation_tasks_print(EVFS_OPERATION(op));
-
evfs_operation_queue_pending_add(EVFS_OPERATION(op));
}
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs