Don't autoremove empty temp file
ClosedPublic

Authored by elvisangelaccio on Nov 7 2017, 4:01 PM.

Details

Summary

Since 5.10 (commit 0dee566e98 in qtbase) Qt complains if we make a
system call with an empty filename (with a "Empty filename passed to
function" runtime warning).

I even hit an assert with my self-compiled build:

ASSERT: "unnamedFile == d_func()->fileEntry.isEmpty()"

(in qtemporaryfile.cpp, line 514).

The problem is that after socketfile.remove() we get an empty
fileName() which will be a problem when the QTemporaryFile gets
destroyed at the end of the if() block.
To avoid this issue we disable the autoremove mode.

Test Plan

No longer get the runtime warning every time a file item gets hovered in KFileWidget.

Diff Detail

Repository
R241 KIO
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
elvisangelaccio created this revision.Nov 7 2017, 4:01 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptNov 7 2017, 4:01 PM
Restricted Application added a subscriber: Frameworks. · View Herald Transcript
dfaure accepted this revision.Nov 8 2017, 6:26 AM
This revision is now accepted and ready to land.Nov 8 2017, 6:26 AM
This revision was automatically updated to reflect the committed changes.