ADD: Elevation delete to trash#878
Open
avmaksimov wants to merge 7 commits intodoublecmd:masterdoublecmd/doublecmd:masterfrom
avmaksimov:elevation-delete-to-trashavmaksimov/doublecmd:elevation-delete-to-trashCopy head branch name to clipboard
Open
ADD: Elevation delete to trash#878avmaksimov wants to merge 7 commits intodoublecmd:masterdoublecmd/doublecmd:masterfrom avmaksimov:elevation-delete-to-trashavmaksimov/doublecmd:elevation-delete-to-trashCopy head branch name to clipboard
avmaksimov wants to merge 7 commits intodoublecmd:masterdoublecmd/doublecmd:masterfrom
avmaksimov:elevation-delete-to-trashavmaksimov/doublecmd:elevation-delete-to-trashCopy head branch name to clipboard
Conversation
Also I did some refactoring to better adding new elevation action. But this version tested only in Windows. The question is about GetLastError
Tested on Ubuntu 22.04
Windows can trash file only if there are right value in registry. So it is not right to show to trash by default (for example for network drives).
Contributor
Author
|
Unfortunately I found some small mistakes and have to fix it. |
Contributor
Author
|
I hope that's all. But it's needed to do some work with checking file or folder before deleting in Windows for max file size. So please check it. And also I suggest to do this checking in TFileSystemDeleteOperation.ProcessFile . Do you agree? mbCheckTrash checks only for drive. |
About optimization: 1) bytes isn't being shown; 2) there is no need to UpdateStatistics two times: before and after. And is really necessary to use CriticalSection? I don't think so because this critical section is being made every times and isn't global.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
It tested in Windows 10 and Ubuntu 22.04. I had to separate some functions to uURIHandling and other changes for Linux.
Also I changed default behavior for Windows: it allow to trash only if a registry value equal some value and default not - it's right for network drives for example.
Also I want to add checking on Windows for size of removing files. Because DC could show information about impossibility to trash files more than max size for trash on this disk.