Bug 302074

Summary: [PATCH] Thumnailer keeps running after exiting gwenview
Product: [Applications] gwenview Reporter: Benni Hill <benni>
Component: generalAssignee: Gwenview Bugs <gwenview-bugs-null>
Severity: critical    
Priority: NOR    
Version: Git (add output of "git log -1 --oneline" to description)   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In: 2.9.1
Attachments: stop-thumbnailer-when-exiting
wait for sThumbnailCache to finish

Description Benni Hill 2012-06-17 16:52:41 UTC
Git Version: e4e135c Fix images not showing after viewing a video

When thumbnailing a folder for which gwenview hasn't created thumbnails yet, the thumbnailer keeps running after exiting gwenview. This is at least an annoying behaviour since this blocks unmounting of flash drives, etc.

I marked this as critical since it might be possible that the user won't notice that unmounting had failed and therefore he would remove his external device (-> data loss?).

Reproducible: Always

Steps to Reproduce:
1. Open a folder for which gwenview has not created thumbnails yet.
2. When gwenview starts to thumbnail the images, hit control+q or similar to exit it
3. main window disappears

Actual Results:  
A gwenview process keeps running and thumbnailing all the images in the queue.

Expected Results:  
Gwenview should have exited immediately.
Comment 1 Benni Hill 2012-06-17 16:54:45 UTC
Created attachment 71892 [details]

The patch deletes the ThumbnailLoadJob when ThumbnailView is deleted.
Comment 2 Aurelien Gateau 2012-06-28 16:20:35 UTC

I agree it is a problem, but your patch just caused an assert here:

ASSERT: "qMetaTypeGuiHelper" in file /home/aurelien/kdesrc/qt/src/corelib/kernel/qmetatype.cpp, line 1384
libpng error: Write Error
gwenview(7376) Gwenview::storeThumbnailToDiskCache: Could not save thumbnail 
QFile::at: Cannot set file position 0 
KCrash: crashing... crashRecursionCounter = 2
KCrash: Application Name = gwenview path = /home/aurelien/opt/k4m/bin pid = 7376

I think we need a safer way to stop the job. I think clearing the item list in the job destructor would be a better fix.
Comment 3 Benni Hill 2012-08-01 00:05:34 UTC
Created attachment 72860 [details]
wait for sThumbnailCache to finish

I think ThumbnailLoadJob has to wait for sThumbnailCache to finish. I don't know why, but somehow the QImage that is to be stored to disk seems to disappear (sometimes).
Comment 4 Aurelien Gateau 2012-08-02 16:08:55 UTC
Git commit 3dbd4e95c9494d4ae5ed51ebfbfa75efeceff97f by Aurélien Gâteau, on behalf of Benni Hill.
Committed on 02/08/2012 at 18:06.
Pushed by gateau into branch 'KDE/4.9'.

Stop thumbnailing when Gwenview exits.

This is important as it blocks unmounting of flash drives.
FIXED-IN: 2.9.1

M  +1    -0    lib/thumbnailloadjob.cpp
M  +1    -0    lib/thumbnailview/thumbnailview.cpp