}
else
{
- ret = system(result->str);
+ ret = !system(result->str);
}
if (path_change) chdir(current_path);
return FALSE;
}
-static void editor_command_start(const gchar *template, const gchar *text, GList *list)
+static gint editor_command_start(const gchar *template, const gchar *text, GList *list)
{
EditorVerboseData *vd;
vd->list = path_list_copy(list);
vd->total = g_list_length(list);
- editor_command_next(vd);
+ return editor_command_next(vd);
}
static gint editor_line_break(const gchar *template, gchar **front, const gchar **end)
while (work)
{
gchar *path = work->data;
- editor_command_one(template, path, NULL);
+ ret = editor_command_one(template, path, NULL);
work = work->next;
}
}
vd = editor_verbose_window(template, text);
editor_verbose_window_progress(vd, _("running..."));
- editor_verbose_start(vd, result->str);
+ ret = editor_verbose_start(vd, result->str);
}
else
{
- int status = system(result->str);
- /* FIXME: consistent return values */
- if (!WIFEXITED(status) || WEXITSTATUS(status))
- ret = FALSE;
+ ret = !system(result->str);
}
g_free(front);
void editor_reset_defaults(void);
gint start_editor_from_file(gint n, const gchar *path);
gint start_editor_from_path_list(gint n, GList *list);
-
gint editor_window_flag_set(gint n);
if (!isfile(path)) return FALSE;
- if (editor_command[CMD_DELETE])
- {
- return start_editor_from_file(CMD_DELETE, path);
- }
if (!safe_delete_enable)
{
{
GList *source_list = data;
+ if (editor_command[CMD_DELETE])
+ {
+ if (!start_editor_from_path_list(CMD_DELETE, source_list))
+ {
+ file_util_warning_dialog(_("File deletion failed"), _("Unable to delete files by external command\n"), GTK_STOCK_DIALOG_ERROR, NULL);
+ }
+ else
+ {
+ while (source_list)
+ {
+ gchar *path = source_list->data;
+ source_list = g_list_remove(source_list, path);
+ file_maint_removed(path, source_list);
+ g_free(path);
+ }
+ }
+ return;
+ }
+
+
while (source_list)
{
gchar *path = source_list->data;
{
gchar *path = data;
- if (!file_util_unlink(path))
+ if (editor_command[CMD_DELETE])
+ {
+ if (!start_editor_from_file(CMD_DELETE, path))
+ {
+ gchar *text = g_strdup_printf(_("Unable to delete file by external command:\n%s"), path);
+ file_util_warning_dialog(_("File deletion failed"), text, GTK_STOCK_DIALOG_ERROR, NULL);
+ g_free(text);
+ }
+ else
+ {
+ file_maint_removed(path, NULL);
+ }
+ }
+ else if (!file_util_unlink(path))
{
gchar *text = g_strdup_printf(_("Unable to delete file:\n%s"), path);
file_util_warning_dialog(_("File deletion failed"), text, GTK_STOCK_DIALOG_ERROR, NULL);