Bug 292733 - Files with thumbnails are sorted last when sorting by Type
Summary: Files with thumbnails are sorted last when sorting by Type
Status: RESOLVED FIXED
Alias: None
Product: dolphin
Classification: Applications
Component: view-engine: general (show other bugs)
Version: 2.0
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Peter Penz
URL:
Keywords:
: 297474 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-01-28 22:45 UTC by Hans Chen
Modified: 2012-06-28 16:23 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.9.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Hans Chen 2012-01-28 22:45:14 UTC
Version:           2.0 (using KDE 4.8.0) 
OS:                Linux

It is especially noticeable in a folder with many video files. When a thumbnail for the first file has been generated (using MPlayerThumbs), it jumps down to the bottom of the list. This continues for every file until the original order is restored.

This is bad because a) it's confusing, and b) you can accidentally open the wrong file because the order is changed.

Reproducible: Always

Steps to Reproduce:
1. Enable previews for Video Files (MPlayerThumbs)
2. Set Sort By Type
3. Enter a folder with many video files, enable previews
4. See how the order is changed as the thumbnails are generated

Actual Results:  
The files with thumbnails are moved to the bottom.

Expected Results:  
The order of the files should not change.
Comment 1 Peter Penz 2012-01-29 08:04:01 UTC
(internal note: consider to trigger the resorting not dependent on the timeout but after all metadata are received)
Comment 2 mijuja_24 2012-03-03 18:15:32 UTC
The problem is more noticeable when files are shown in groups. At first, files are shown all together and then, as the thumbnails are generated, they move to their correct group. In folders with many files, it takes a lot of time until all previews are generated and the files are correctly shown in groups.

In my case, the problem is not specific with video files, it can happen with any folder with many files and thumbnails enabled. It is also reproducible when sorting files by date. 

Using KDE 4.8.0 on Kubuntu 11.10
Comment 3 Peter Penz 2012-04-04 14:45:17 UTC
*** Bug 297474 has been marked as a duplicate of this bug. ***
Comment 4 Mirza 2012-04-04 17:51:48 UTC
Also happens when sorted by size.
Comment 5 Peter Penz 2012-04-04 19:16:29 UTC
It happens with all sort-types that are determined asynchronously. I'll try to increase the acceptable delay, so that the current "flickering" does not occur anymore. However determining for example the types of e.g. /usr/bin can (as kind of worst case) take up > 20 seconds - in such a case it might be preferable to show the content first and update the sorting later. But a kind of progress/busy-indicator would be useful of course... Well, I confirm that the current behavior is not nice and will try to improve it.
Comment 6 Peter Penz 2012-04-10 14:36:50 UTC
Git commit 99ccc5f49dc3358751b300d50c9a9ba1b322dc08 by Peter Penz.
Committed on 10/04/2012 at 16:30.
Pushed by ppenz into branch 'master'.

Improvements for slow sorting roles

If the sorting is done for data which is resolved asynchronously
(e.g. rating), it is important to give a visual feedback about
the state of the sorting. This is done now by a progress
indication in the statusbar.

Also optimizations for "Sort by type" have been done: Although
resolving a type can be expensive in the most often case it is a
very cheap operation. So it the sorting is done by type, try
to resolve the type synchronously for at least 200 ms to prevent
a asynchronous resorting. This is usually sufficient to have
resolved types even for directories with several thousands of
items.
FIXED-IN: 4.9.0

M  +12   -3    dolphin/src/dolphinviewcontainer.cpp
M  +3    -1    dolphin/src/dolphinviewcontainer.h
M  +50   -0    dolphin/src/kitemviews/kfileitemmodel.cpp
M  +21   -0    dolphin/src/kitemviews/kfileitemmodel.h
M  +92   -7    dolphin/src/kitemviews/kfileitemmodelrolesupdater.cpp
M  +21   -0    dolphin/src/kitemviews/kfileitemmodelrolesupdater.h
M  +2    -2    dolphin/src/kitemviews/knepomukrolesprovider.cpp
M  +2    -2    dolphin/src/kitemviews/knepomukrolesprovider_p.h
M  +1    -1    dolphin/src/statusbar/dolphinstatusbar.cpp
M  +1    -0    dolphin/src/views/dolphinview.cpp
M  +2    -2    dolphin/src/views/dolphinview.h

http://commits.kde.org/kde-baseapps/99ccc5f49dc3358751b300d50c9a9ba1b322dc08
Comment 7 Wiktor 2012-06-28 16:23:42 UTC
Great news to see, this was repaired. Thanks!!! :)