Bug 94336 - Playing tempfiles in kaffeine
Summary: Playing tempfiles in kaffeine
Status: RESOLVED FIXED
Alias: None
Product: kaffeine
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: Christophe Thommeret
URL:
Keywords:
: 141077 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-12-03 17:44 UTC by Petr Kopecký
Modified: 2010-05-08 17:20 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Kopecký 2004-12-03 17:44:27 UTC
Version:           1.7.1 (using KDE KDE 3.3.1)
Installed from:    Gentoo Packages
OS:                Linux

When opening mail attachements from Kmail, clicking on attachement e.g. video file selecting "Open with Kaffeine" it opens Kaffeine but with link to nonexistent file (e.g.: /tmp/kde-user/video.wmv_[some_random_string].wmv but the file is located in /tmp/kde-user/kmailsome_random_string/). The same is for images.
Comment 1 Christian Spitzlay 2004-12-16 07:01:51 UTC
I could reproduce this problem with KDE 3.3.1 as well as with a recent CVS HEAD.
Comment 2 Christian Spitzlay 2004-12-16 07:19:12 UTC
Additional info:  

My System: Debian (so this is not Gentoo-specific)
- KDE 3.3.1 from Debian Sid
- KDE CVS HEAD compiled from source

It seems to work for me with some attachments (images opening in kuickshow), 
but not with others (mpgs opening with kaffeine).  

The images don't seem to be saved to a subfolder (so the path passed to the 
application is correct), but movies are. 


Comment 3 Christian Spitzlay 2005-05-19 07:54:45 UTC
This bug seems to be fixed in KDE 3.4.0.  It works now (KDE 3.4 experimental packages on Debian Sarge) with an email that reproduced the error in 3.3.1 and CVS of that time.

@Petr:  Could you (as the reporter) please retry it with KDE 3.4 so this bug report can be closed? 
Comment 4 Christian Spitzlay 2005-06-01 23:20:55 UTC
Hmm.  There still is an error.  Kaffeine *does* now play the movie I had as attachment in the test mail, but only the first time.  

As soon as I hit the play button to restart the mpg kaffeine complains that it cannot find the file /tmp/kde-cmueller/Redlight.mpg_[l56Dsc].mpg.  

The process list shows the (wrong) command line: 
kaffeine /tmp/kde-cmueller/Redlight.mpg_[l56Dsc].mpg

The respective attachment is saved under: 
/tmp/kde-cmueller/kontactRDwrlc.3/Redlight.mpg

The first time it plays the movie so the correct location must have been passed, but also the wrong one... this looks even stranger to me than the original bug...

Comment 5 Thomas McGuire 2007-02-02 16:54:11 UTC
*** Bug 141077 has been marked as a duplicate of this bug. ***
Comment 6 Philip Rodrigues 2007-02-03 00:10:49 UTC
I suspect this is just bug 130709
Comment 7 Christian Spitzlay 2007-02-03 08:54:39 UTC
But there are two temp file locations involved.  Does that mean that Kmail saves the attachment twice in this case? Once for itself and once for the app that is started when one clicks on the attachent icon?  If that were true then it would indeed look like a dupe of #130709. 

Still reproducible in KDE 3.5.6, BTW.

Comment 8 Jonathan Marten 2007-02-03 12:02:53 UTC
Yes, there are two temporary files involved (but not saved twice, one is just hard linked to the other).  This was introduced to fix bug 39537.

See bug 130709 for a patch to fix.
Comment 9 Christian Spitzlay 2007-02-04 00:15:51 UTC
@Jonathan:  Thanks for the explanation. 

I've seen the patch and your comment in the other bug.  If I understand correctly it delays deletion of the file so that the application forked by the wrapper can start up and open the file before it's deleted.  As long as it keeps the file open the app is not affected by the fact that deletion happens on the file system level after the 120 seconds delay. 

If that's true then I guess the patch doesn't fix the whole problem:  When viewing a movie a second or third time kaffeine seems to close and try to reopen the file (which is gone if the 120 seconds have already passed so an error is thrown).  There may be other apps that behave the same as kaffeine, and I don't think that behaviour is a bug per se.

Comment 10 Christian Spitzlay 2007-02-04 00:19:16 UTC
> When viewing a movie a second or third time [...]

I mean viewing several times from inside the started kaffeine instance, not by clicking the attachment in KMail repeatedly. 

Comment 11 Jonathan Marten 2007-02-04 20:37:39 UTC
It's true that the patch in 130709 does not completely fix the problem, which is why it probably won't be implemented as is.  We need a better solution.

Comment 12 Jonathan Marten 2007-02-04 20:45:58 UTC

*** This bug has been marked as a duplicate of 130709 ***
Comment 13 David Faure 2007-02-04 21:02:09 UTC
The "better solution" is to implement --tempfile in kaffeine so that it says "I handle the deletion of the tempfile myself" - after playing the movie as many times as it wants. With X-KDE-HasTempFileOption=true in its .desktop file, kaffeine can indicate that it supports the option, and then kmail/kioexec won't delete the file, kaffeine will.
Comment 14 David Faure 2007-03-11 23:36:20 UTC
Reassigning to kaffeine
Comment 15 Christoph Pfister 2010-05-08 17:20:25 UTC
proper --tempfile support is implemented in kaffeine svn
thanks