Allow to open attachments by double-click
ClosedPublic

Authored by ervin on Aug 11 2017, 10:59 PM.

Details

Summary

I didn't feel like stubbing away that one for testing since it jumps
straight at QTemporaryFile and QDesktopServices here. Probably better to
keep it as a simple ten lines method in that case.

Diff Detail

Repository
R4 Zanshin
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
ervin created this revision.Aug 11 2017, 10:59 PM
dfaure requested changes to this revision.Aug 12 2017, 10:14 PM
dfaure added inline comments.
src/presentation/artifacteditormodel.cpp
305

Technically not leaked, but any long-running system that then crashes, will not delete all these tempfiles.
(or if just zanshin crashes after, say, 20 days)

I wonder what strategy KMail uses for viewing attachments, check with Laurent?

BTW I have implemented a solution where the app itself deletes the tempfile after use, in some KDE apps. KRun's tempfile argument supports this, and fallsback to kioexec if the app doesn't support it, so a solution would be to use KRun instead of QDesktopServices.

306

autoremove is on by default

This revision now requires changes to proceed.Aug 12 2017, 10:14 PM
ervin added inline comments.Aug 13 2017, 8:41 PM
src/presentation/artifacteditormodel.cpp
305

I'm using the same strategy than KOrganizer here. Also, I'd rather stay away from KRun if I can... I wonder if there's any other mechanism which could be used to clean up the temp files. Note that most modern distros swipe /tmp regularly AFAIK.

dfaure accepted this revision.Aug 13 2017, 9:17 PM

OpenSuSE doesn't appear to wipe /tmp. I have temporary files from 2016 in there ;)

But OK, if it's good enough for KOrganizer, we can leave it as that.

This revision is now accepted and ready to land.Aug 13 2017, 9:17 PM
ervin updated this revision to Diff 18114.Aug 13 2017, 11:06 PM

Addresses dfaure's comments

dfaure accepted this revision.Aug 14 2017, 10:55 AM
bensi accepted this revision.Aug 14 2017, 3:42 PM
This revision was automatically updated to reflect the committed changes.