Bug 171391 - dolphin reports wrong item count on selected items->properties page
Summary: dolphin reports wrong item count on selected items->properties page
Status: RESOLVED FIXED
Alias: None
Product: dolphin
Classification: Applications
Component: general (show other bugs)
Version: 16.12.2
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Peter Penz
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-21 12:11 UTC by Fab
Modified: 2010-09-19 17:31 UTC (History)
5 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 Fab 2008-09-21 12:11:10 UTC
Version:            (using Devel)
OS:                Linux
Installed from:    Compiled sources

Dolphin does not count files correctly. Go to a random folder (folder A) with a subfolder. Select all subfolders. Right-click on selection, choose Properties. There, the correct number of files in all selected subfolders is presented.

Next, select all subfolders and one additional file in folder A. Again right-click on selection and choose Properties. The additionally selected file is not counted.

Example:
Create new empty folder A.
Create a subfolder of A called B.
Create a file in A called C.

Select B. Properties lists 0 files, 0 subfolders.
Select B and C. Properties still lists 0 files, 0 subfolders.

Create file in subfolder B called D.
Select B and C. Properties lists 1 files, 0 subfolders.


This error occurs in Dolphin 1.1.80 from the kde-nightly build from project-neon on Kubuntu Inrepid (latest version).
Comment 1 Dario Andres 2008-11-30 13:40:09 UTC
I can reproduce this bug in KDE4.2 svn (kdelibs rev. 890607/ kdebase rev. 890066). The behaviour is also the same in KDE 4.1.3 (both in my ArchLinux x86_64 box)

When you select "B" and "C" (and before creating "D") , and go to properties, in the top of the dialog, it says 1 file and 1 folder (the selected items). but, below the "Location:" text (Location is "A" folder), in the size field it says "0 files, 0 folders" (incorrect item count for the "A" folder). Is like that it wasn't the item count for "A", but for "B" (selected) folder, which doesn't have anything inside.

However if you RMB on an empty space inside the "A" folder, and go to properties, it will correctly count the files inside "A" , in this case "1 file , 1 folder" (for folder "B" and file "C")
Comment 2 Ingo Klöcker 2009-03-29 14:38:58 UTC
IMO this is not a bug, but a misinterpretation of the information shown in the Properties dialog. The dialog (opened via the context menu of the selected items) shows the properties of the selected items B and C. Neither B nor C contain any files or sub-folders (before the creation of D), so the counts (0 files, 0 sub-folders) are correct in my opinion.

FWIW, Konqueror 3.5.9 shows exactly the same behavior which is a strong indication that the dialog shows what it is meant to show.

Also, Fab's expectation to get 1 file, 0 sub-folders is inconsistent. Either the selected items (i.e. files _and_ folders) are included in the counts (i.e. 1 file, 1 sub-folders if B and C are selected) or they are not included.
Comment 3 Rahman Duran 2009-03-29 14:46:16 UTC
@Ingo Klöcker

You misundertood the problem. The problem is: if you select a directory and a file, the dialog doesn't count the selected file. 

Select a dir that  contains n files in it. if you select this dir and a file the dialog shows n files instead of n+1. Problem is it only counts the files in the selected dirs. A pacth is waiting at reviewboard.kde.org. I will commit it soon.
Comment 4 Ingo Klöcker 2009-03-29 16:40:56 UTC
@Rahman Duran: I understand perfectly what you think the problem is. I disagree with you and claim that this is not a problem, but that you are making wrong assumptions about what the numbers should be. Instead of fixing KIO::directorySizeJob (which IMO does not need fixing) the Properties dialog should be changed/improved to better convey the meaning of the numbers.
Comment 5 Rahman Duran 2009-03-30 11:30:15 UTC
SVN commit 946754 by rduran:

BUG: 171391

Fix the wrong file count in file properties dialog



 M  +4 -1      directorysizejob.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=946754
Comment 6 Dotan Cohen 2009-05-06 14:10:23 UTC
I can confirm this bug with the reproduction instructions in the OP in Dolphin of KDE 4.2.2.

Ingo, I understand that the is the behaviour that you want, however it is not what the user expects. I think that the solution might be to replace this text:
0 subfolders, 0 files
with this:
1 folder, 0 subfolders, 1 file

In this way you can distinguish between top-level directiories and subdirectories. Files should not have this distinction.
Comment 7 Ingo Klöcker 2009-05-06 21:06:24 UTC
@Dotan: Yes, good suggestion.
Comment 8 Mark 2010-09-19 03:27:41 UTC
Decision time.. What are we gonna do with this one?
Comment 9 Dotan Cohen 2010-09-19 14:01:14 UTC
What's wrong with the suggestion from Comment #6?
Comment 10 Mark 2010-09-19 14:55:35 UTC
@Dotan, lets wait for Peter to reply on this oke?
Comment 11 Peter Penz 2010-09-19 17:31:53 UTC
From my point of view this bug can be closed as fixed: The bug from the original report has been fixed by the commit from comment #5. If there is still something wrong from your point of view, I'd kindly ask to open a new report which describes the open issue in detail (from my point of view the UI can be interpreted in different ways and there might be room for improvements). Thanks!