[gnome-commander] Invert if-condition - only if deletion of subdirs was performed, delete the parent dir
- From: Uwe Scholz <uwescholz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-commander] Invert if-condition - only if deletion of subdirs was performed, delete the parent dir
- Date: Sun, 28 Nov 2021 21:34:25 +0000 (UTC)
commit b28960c8e93ec4f6bd237b6d3699f1d02a8e85a2
Author: Uwe Scholz <u scholz83 gmx de>
Date: Sun Nov 28 22:25:11 2021 +0100
Invert if-condition - only if deletion of subdirs was performed, delete the parent dir
src/dialogs/gnome-cmd-delete-dialog.cc | 21 ++++++++++++---------
1 file changed, 12 insertions(+), 9 deletions(-)
---
diff --git a/src/dialogs/gnome-cmd-delete-dialog.cc b/src/dialogs/gnome-cmd-delete-dialog.cc
index 6e4178bd..143530a4 100644
--- a/src/dialogs/gnome-cmd-delete-dialog.cc
+++ b/src/dialogs/gnome-cmd-delete-dialog.cc
@@ -214,14 +214,18 @@ static gboolean perform_delete_operation_r(DeleteData *deleteData, GList *gnomeC
auto gnomeCmdDir = GNOME_CMD_DIR (gnomeCmdFile);
gnome_cmd_dir_list_files (gnomeCmdDir, FALSE);
- if (!perform_delete_subdirs(gnomeCmdDir, deleteData))
+ if (perform_delete_subdirs(gnomeCmdDir, deleteData))
+ {
+ // Now remove the directory itself, as it is finally empty
+ GList *directory = nullptr;
+ directory = g_list_append(directory, gnomeCmdFile);
+ perform_delete_operation_r (deleteData, directory);
+ g_list_free(directory);
+ }
+ else if (deleteData->stop)
+ {
return FALSE;
-
- // Now remove the directory itself, as it is finally empty
- GList *directory = nullptr;
- directory = g_list_append(directory, gnomeCmdFile);
- perform_delete_operation_r (deleteData, directory);
- g_list_free(directory);
+ }
}
else if (tmpError)
{
@@ -229,8 +233,7 @@ static gboolean perform_delete_operation_r(DeleteData *deleteData, GList *gnomeC
g_propagate_error (&(deleteData->error), tmpError);
deleteData->problemFileName = gnomeCmdFile->get_name();
delete_progress_update(deleteData);
- if (deleteData->stop)
- return FALSE;
+ return FALSE;
}
deleteData->deletedGnomeCmdFiles = g_list_append(deleteData->deletedGnomeCmdFiles, gnomeCmdFile);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]