Branch: refs/heads/master Author: Enrico Tröger enrico.troeger@uvena.de Committer: GitHub noreply@github.com Date: Sun, 30 Jan 2022 21:18:02 UTC Commit: cc23333ef23bb5d2a18745d309757553505fee0d https://github.com/geany/geany-plugins/commit/cc23333ef23bb5d2a18745d3097575...
Log Message: ----------- Merge pull request #1125 from xiota/pr-prjorg-trash
Project Organizer: Use system trash for file/folder removal
Modified Paths: -------------- projectorganizer/src/prjorg-utils.c
Modified: projectorganizer/src/prjorg-utils.c 9 lines changed, 8 insertions(+), 1 deletions(-) =================================================================== @@ -149,9 +149,16 @@ gboolean create_dir(char *utf8_name)
gboolean remove_file_or_dir(char *utf8_name) { + gboolean ret = FALSE; gchar *name = utils_get_locale_from_utf8(utf8_name); - gboolean ret = g_remove(utf8_name) == 0; + + GFile *file = g_file_new_for_path(name); + ret = g_file_trash(file, NULL, NULL); + if (!ret) + ret = g_file_delete(file, NULL, NULL); + g_free(name); + g_object_unref(file); return ret; }
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
plugins-commits@lists.geany.org