ksnapshot: fix temp file handling

Review Request #121796 - Created Jan. 2, 2015 and submitted

Information
Gregor Mi
ksnapshot
frameworks
Reviewers
kdegraphics, ksnapshot
dfaure, lukas

Fixes the bug discovered by David:

It deletes the QTemporaryFile just after saving to it.

Lukas, this is due to your removal of tmpFile.setAutoRemove(false) in
3bc66a71b02704f9e70ffb8239c886a1b61154c9

It makes KSnapshot::urlToOpen delete the file right away, i.e. it returns a 
path to a file that doesn't exist anymore. No wonder kio can't find it.

SendTo works for Kolourpaint, MyPaint, ImageViewer, ...

With Gwenview, there is still the command line parsing error:

$KDEDIR/lib64/libexec/kf5/kioexec --tempfiles 'gwenview %U' -caption Gwenview 
--icon gwenview /tmp/route.png
Unknown options: c, a, p, t, i, o, n, icon.

This is independent of this RR.

Lukáš Tinkl
Gregor Mi
Review request changed

Status: Closed (submitted)

Change Summary:

http://commits.kde.org/ksnapshot/9a015dd465c33c173e839f053a3bf0ac97172ff5

Loading...