kioexec: Do not start to watch a temporary copy until after the copy is complete
ClosedPublic

Authored by marten on Sep 15 2017, 3:35 PM.

Details

Summary

As described in bug https://bugs.kde.org/show_bug.cgi?id=384500, there appears to be a problem when the receiving application of a file needs a temporary copy to be made (because of %F/%f in its desktop file). The kded file watching module is told to watch the file too early, before the ioslave has even started to copy it. This means that when the copy is complete it will receive a dirty signal (on file creation) and the user will immediately be prompted to re-upload.

This change moves the file watch operation to after the file copy job is complete. At this point the file is in a stable state and hence the dirty signal and the prompt will not happen, unless the file really is subsequently modified.

Test Plan

Built and installed kio with this change, checked remote file opening as per the bug. Verified that the kded module is not told to watch the file until after the copy is complete, and that there is no re-upload prompt unless the file is actually modified.

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.
marten created this revision.Sep 15 2017, 3:35 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptSep 15 2017, 3:35 PM
dfaure accepted this revision.Sep 24 2017, 11:06 AM

Makes sense.

src/kioexec/main.cpp
151

(pre-existing) std::find_if with a lambda would be shorter and (imho) more readable, but feel free to ignore this if you're not at ease with that

166

clean up the debug output please

This revision is now accepted and ready to land.Sep 24 2017, 11:06 AM
marten updated this revision to Diff 19864.Sep 24 2017, 2:32 PM

Updated in accordance with review comments. Go easy - it's the first lambda that I've submitted...

marten marked 2 inline comments as done.Sep 24 2017, 2:32 PM
dfaure accepted this revision.Sep 24 2017, 6:38 PM

Perfect, thanks.

This revision was automatically updated to reflect the committed changes.