nautilus r13689 - in trunk: . libnautilus-private
- From: alexl svn gnome org
- To: svn-commits-list gnome org
- Subject: nautilus r13689 - in trunk: . libnautilus-private
- Date: Mon, 4 Feb 2008 10:33:54 +0000 (GMT)
Author: alexl
Date: Mon Feb 4 10:33:53 2008
New Revision: 13689
URL: http://svn.gnome.org/viewvc/nautilus?rev=13689&view=rev
Log:
2008-02-04 Alexander Larsson <alexl redhat com>
* libnautilus-private/nautilus-file-operations.c:
Don't follow symlinks when emptying trash (#513912)
Modified:
trunk/ChangeLog
trunk/libnautilus-private/nautilus-file-operations.c
Modified: trunk/libnautilus-private/nautilus-file-operations.c
==============================================================================
--- trunk/libnautilus-private/nautilus-file-operations.c (original)
+++ trunk/libnautilus-private/nautilus-file-operations.c Mon Feb 4 10:33:53 2008
@@ -4885,7 +4885,8 @@
static void
delete_trash_file (CommonJob *job,
GFile *file,
- gboolean del_dir)
+ gboolean del_file,
+ gboolean del_children)
{
GFileInfo *info;
GFile *child;
@@ -4894,26 +4895,30 @@
if (job_aborted (job)) {
return;
}
-
- enumerator = g_file_enumerate_children (file,
- G_FILE_ATTRIBUTE_STANDARD_NAME,
- G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS,
- job->cancellable,
- NULL);
- if (enumerator) {
- while (!job_aborted (job) &&
- (info = g_file_enumerator_next_file (enumerator, job->cancellable, NULL)) != NULL) {
- child = g_file_get_child (file,
- g_file_info_get_name (info));
- delete_trash_file (job, child, TRUE);
- g_object_unref (child);
- g_object_unref (info);
+
+ if (del_children) {
+ enumerator = g_file_enumerate_children (file,
+ G_FILE_ATTRIBUTE_STANDARD_NAME ","
+ G_FILE_ATTRIBUTE_STANDARD_TYPE,
+ G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS,
+ job->cancellable,
+ NULL);
+ if (enumerator) {
+ while (!job_aborted (job) &&
+ (info = g_file_enumerator_next_file (enumerator, job->cancellable, NULL)) != NULL) {
+ child = g_file_get_child (file,
+ g_file_info_get_name (info));
+ delete_trash_file (job, child, TRUE,
+ g_file_info_get_file_type (info) == G_FILE_TYPE_DIRECTORY);
+ g_object_unref (child);
+ g_object_unref (info);
+ }
+ g_file_enumerator_close (enumerator, job->cancellable, NULL);
+ g_object_unref (enumerator);
}
- g_file_enumerator_close (enumerator, job->cancellable, NULL);
- g_object_unref (enumerator);
- }
+ }
- if (!job_aborted (job) && del_dir) {
+ if (!job_aborted (job) && del_file) {
g_file_delete (file, job->cancellable, NULL);
}
}
@@ -4952,7 +4957,7 @@
for (l = job->trash_dirs;
l != NULL && !job_aborted (common);
l = l->next) {
- delete_trash_file (common, l->data, FALSE);
+ delete_trash_file (common, l->data, FALSE, TRUE);
}
g_io_scheduler_job_send_to_mainloop_async (io_job,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]