Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
thunar
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Joey Riches
thunar
Commits
00122061
Commit
00122061
authored
2 years ago
by
Alexander Schwinn
Browse files
Options
Downloads
Patches
Plain Diff
Revert "Prevent deletion of modified files by undo (#1027)"
This reverts commit
a038f5ed
.
parent
aee2df8b
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
thunar/thunar-job-operation-history.c
+7
-5
7 additions, 5 deletions
thunar/thunar-job-operation-history.c
thunar/thunar-job-operation.c
+7
-13
7 additions, 13 deletions
thunar/thunar-job-operation.c
with
14 additions
and
18 deletions
thunar/thunar-job-operation-history.c
+
7
−
5
View file @
00122061
...
...
@@ -206,10 +206,12 @@ thunar_job_operation_history_commit (ThunarJobOperation *job_operation)
_thunar_return_if_fail
(
THUNAR_IS_JOB_OPERATION
(
job_operation
));
/* set the timestamp for the operation, in seconds. g_get_real_time gives
* us the time in microseconds, so we need to divide by 1e6. */
thunar_job_operation_set_end_timestamp
(
job_operation
,
g_get_real_time
()
/
(
gint64
)
1e6
);
if
(
thunar_job_operation_get_kind
(
job_operation
)
==
THUNAR_JOB_OPERATION_KIND_TRASH
)
{
/* set the timestamp for the operation, in seconds. g_get_real_time gives
* us the time in microseconds, so we need to divide by 1e6. */
thunar_job_operation_set_end_timestamp
(
job_operation
,
g_get_real_time
()
/
(
gint64
)
1e6
);
}
g_mutex_lock
(
&
job_operation_history
->
job_operation_list_mutex
);
...
...
@@ -452,7 +454,7 @@ thunar_job_operation_history_redo (void)
thunar_job_operation_execute
(
operation_marker
,
&
err
);
if
(
err
==
NULL
)
thunar_notify_redo
(
operation_marker
);
thunar_notify_redo
(
operation_marker
);
g_mutex_unlock
(
&
job_operation_history
->
job_operation_list_mutex
);
...
...
This diff is collapsed.
Click to expand it.
thunar/thunar-job-operation.c
+
7
−
13
View file @
00122061
...
...
@@ -50,7 +50,10 @@ struct _ThunarJobOperation
/* Files overwritten as a part of an operation */
GList
*
overwritten_files
;
/** timestamps (in seconds) which tell when the operation was started and ended. */
/**
* Optional timestamps (in seconds) which tell when the operation was started and ended.
* Only used for trash/restore operations.
**/
gint64
start_timestamp
;
gint64
end_timestamp
;
};
...
...
@@ -365,9 +368,6 @@ thunar_job_operation_new_invert (ThunarJobOperation *job_operation)
break
;
}
inverted_operation
->
start_timestamp
=
job_operation
->
start_timestamp
;
inverted_operation
->
end_timestamp
=
job_operation
->
end_timestamp
;
return
inverted_operation
;
}
...
...
@@ -391,8 +391,6 @@ thunar_job_operation_execute (ThunarJobOperation *job_operation,
GFile
*
parent_dir
;
gchar
*
display_name
;
GFile
*
template_file
;
guint64
changed_stamp
;
gboolean
warn_permanent_delete
=
FALSE
;
_thunar_return_if_fail
(
THUNAR_IS_JOB_OPERATION
(
job_operation
));
...
...
@@ -424,16 +422,12 @@ thunar_job_operation_execute (ThunarJobOperation *job_operation,
continue
;
}
/* If nothing changed, we can just bring back the file with undo/redo
* Though if any file was modified, we need to ask if deletion is ok */
changed_stamp
=
thunar_file_get_date
(
thunar_file
,
THUNAR_FILE_DATE_MODIFIED
);
if
(
changed_stamp
>
(
guint64
)
job_operation
->
end_timestamp
)
warn_permanent_delete
=
TRUE
;
thunar_file_list
=
g_list_append
(
thunar_file_list
,
thunar_file
);
}
thunar_application_unlink_files
(
application
,
NULL
,
thunar_file_list
,
TRUE
,
warn_permanent_delete
,
THUNAR_OPERATION_LOG_OPERATIONS
);
/* perform permanent deletion without warning, because we can bring back the file with
* an undo or a redo (depending on whether a redo or an undo caused the deletion) */
thunar_application_unlink_files
(
application
,
NULL
,
thunar_file_list
,
TRUE
,
FALSE
,
THUNAR_OPERATION_LOG_OPERATIONS
);
thunar_g_list_free_full
(
thunar_file_list
);
break
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment