forked from enlightenment/enlightenment
E17: remove useless symlink (as we don't rename anymore) and remove useless function _e_fm_op_update_progress_report_simple()
Patch by Maxime Villard SVN revision: 75698
This commit is contained in:
parent
95909021ea
commit
f84af67928
|
@ -66,7 +66,6 @@ static Eina_Bool _e_fm_op_scan_idler(void *data);
|
|||
|
||||
static void _e_fm_op_send_error(E_Fm_Op_Task *task, E_Fm_Op_Type type, const char *fmt, ...);
|
||||
static void _e_fm_op_rollback(E_Fm_Op_Task *task);
|
||||
static void _e_fm_op_update_progress_report_simple(int percent, const char *src, const char *dst);
|
||||
static void _e_fm_op_update_progress(E_Fm_Op_Task *task, off_t _plus_e_fm_op_done, off_t _plus_e_fm_op_total);
|
||||
static void _e_fm_op_copy_stat_info(E_Fm_Op_Task *task);
|
||||
static int _e_fm_op_handle_overwrite(E_Fm_Op_Task *task);
|
||||
|
@ -181,7 +180,7 @@ main(int argc, char **argv)
|
|||
{
|
||||
char buf[PATH_MAX];
|
||||
char *p2, *p3;
|
||||
int p2_len, last_len, done, total;
|
||||
size_t p2_len, last_len;
|
||||
|
||||
p2 = ecore_file_realpath(argv[last]);
|
||||
if (!p2) goto quit;
|
||||
|
@ -202,14 +201,11 @@ main(int argc, char **argv)
|
|||
|
||||
p3 = buf + last_len;
|
||||
|
||||
done = 0;
|
||||
total = last - 2;
|
||||
|
||||
for (; i < last; i++)
|
||||
{
|
||||
char *p = ecore_file_realpath(argv[i]);
|
||||
const char *name;
|
||||
int name_len;
|
||||
size_t name_len;
|
||||
|
||||
if (!p) continue;
|
||||
|
||||
|
@ -225,29 +221,20 @@ main(int argc, char **argv)
|
|||
if (p2_len + name_len >= PATH_MAX) goto skip_arg;
|
||||
memcpy(p3, name, name_len + 1);
|
||||
|
||||
if ((type == E_FM_OP_SYMLINK) &&
|
||||
(symlink(argv[i], buf) == 0))
|
||||
{
|
||||
done++;
|
||||
_e_fm_op_update_progress_report_simple
|
||||
(done * 100 / total, argv[i], buf);
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((type == E_FM_OP_MOVE) &&
|
||||
(!strcmp(argv[i],buf)))
|
||||
goto skip_arg;
|
||||
if ((type == E_FM_OP_MOVE) &&
|
||||
(!strcmp(argv[i],buf)))
|
||||
goto skip_arg;
|
||||
|
||||
E_Fm_Op_Task *task;
|
||||
/* Creating task */
|
||||
E_Fm_Op_Task *task;
|
||||
|
||||
task = _e_fm_op_task_new();
|
||||
task->type = type;
|
||||
task->src.name = eina_stringshare_add(argv[i]);
|
||||
task->dst.name = eina_stringshare_add(buf);
|
||||
task = _e_fm_op_task_new();
|
||||
task->type = type;
|
||||
task->src.name = eina_stringshare_add(argv[i]);
|
||||
task->dst.name = eina_stringshare_add(buf);
|
||||
|
||||
_e_fm_op_scan_queue =
|
||||
eina_list_append(_e_fm_op_scan_queue, task);
|
||||
}
|
||||
_e_fm_op_scan_queue =
|
||||
eina_list_append(_e_fm_op_scan_queue, task);
|
||||
|
||||
skip_arg:
|
||||
E_FREE(p);
|
||||
|
@ -268,22 +255,14 @@ skip_arg:
|
|||
E_FREE(p2);
|
||||
if (i) goto quit;
|
||||
|
||||
if ((type == E_FM_OP_SYMLINK) &&
|
||||
(symlink(argv[2], argv[3]) == 0))
|
||||
{
|
||||
_e_fm_op_update_progress_report_simple(100, argv[2], argv[3]);
|
||||
goto quit;
|
||||
}
|
||||
else
|
||||
{
|
||||
E_Fm_Op_Task *task;
|
||||
/* Creating task */
|
||||
E_Fm_Op_Task *task;
|
||||
|
||||
task = _e_fm_op_task_new();
|
||||
task->type = type;
|
||||
task->src.name = eina_stringshare_add(argv[2]);
|
||||
task->dst.name = eina_stringshare_add(argv[3]);
|
||||
_e_fm_op_scan_queue = eina_list_append(_e_fm_op_scan_queue, task);
|
||||
}
|
||||
task = _e_fm_op_task_new();
|
||||
task->type = type;
|
||||
task->src.name = eina_stringshare_add(argv[2]);
|
||||
task->dst.name = eina_stringshare_add(argv[3]);
|
||||
_e_fm_op_scan_queue = eina_list_append(_e_fm_op_scan_queue, task);
|
||||
}
|
||||
else
|
||||
goto quit;
|
||||
|
@ -961,14 +940,6 @@ _e_fm_op_update_progress_report(int percent, int eta, double elapsed, off_t done
|
|||
E_FM_OP_DEBUG("Progress %d. \n", percent);
|
||||
}
|
||||
|
||||
static void
|
||||
_e_fm_op_update_progress_report_simple(int percent, const char *src, const char *dst)
|
||||
{
|
||||
size_t done = (percent * REMOVECHUNKSIZE) / 100;
|
||||
_e_fm_op_update_progress_report
|
||||
(percent, 0, 0, done, REMOVECHUNKSIZE, src, dst);
|
||||
}
|
||||
|
||||
/* Updates progress.
|
||||
* _plus_data is how much more works is done and _plus_e_fm_op_total
|
||||
* is how much more work we found out needs to be done
|
||||
|
|
Loading…
Reference in New Issue