Don't assert deleting the temporary file
Changes PlannedPublic

Authored by jtamate on Sep 10 2018, 3:28 PM.

Details

Reviewers
dfaure
Group Reviewers
Frameworks
Summary

Change the names of the temporary files to something more difficult for other KDE programs to create.
Remove the asserts.
In the very unlikely situation when the preview temporary file has been replaced by other temporary file, nothing can be done to avoid to delete the file.

Test Plan

With a lot of images in the trash, while dolphin create the previews, empty the trash. (It can take a while, around 3000 images, until it asserts).
Before: a crash in the second assert (Is a file?), because the temporary file was already deleted, therefore it is not a file.

Diff Detail

Repository
R241 KIO
Lint
Lint Skipped
Unit
Unit Tests Skipped
jtamate created this revision.Sep 10 2018, 3:28 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptSep 10 2018, 3:28 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
jtamate requested review of this revision.Sep 10 2018, 3:28 PM
dfaure accepted this revision.Mar 3 2019, 12:21 AM
This revision is now accepted and ready to land.Mar 3 2019, 12:21 AM
jtamate planned changes to this revision.Mar 5 2019, 6:29 PM

The more I try to understand my own explanations, the less I agree with my past me.

  • Reading again the QTemporary documentation, without anything, the constructor creates a temporary file in the temp directory with prefix the application name.
    • Why would the temporary file be deleted if the trash is being emptied?
      • Unless KIO::file_copy closes the file if the origin file to be copied is not available. If it is the case, a comment is needed.

Also the asserts were modified by commit 7ce34436a0387f3620e3f47ea7252d151e839776