Review Request: Fix KIO::directorySizeJob returns wrong file count in some situtaions.

Rahman Duran rahman.duran at gmail.com
Sun Mar 29 16:05:12 BST 2009



> On 2009-03-29 05:41:12, Ingo Klöcker wrote:
> > I don't see anything wrong with the current behavior. 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.
> > 
> > Fab's expectation to get 1 file, 0 sub-folders is inconsistent. Either all 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.
> > 
> > FWIW, Konqueror 3.5.9 shows exactly the same behavior which appears to be a strong indication that the dialog shows what it is meant to show.
> >
> 
> Rahman Duran wrote:
>     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.
> 
> Ingo Klöcker wrote:
>     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. With your reasoning the folder dir in test would have to be counted as well, i.e. the dialog should show "9 files, 1 sub-folders" instead of "4 files, 0 sub-folders".
>     
>     Instead of fixing KIO::directorySizeJob (which IMO does not need fixing) I suggest improving the way the Properties dialog presents the numbers.
>     
>

Well, directorySizeJob adds the sizes of "1,2,3,4,5" to total size. So it's supposed to add "1,2,3,4,5" to total file count too. Imagine that "dir/" has 4 files (as in screenshot) that total of 10 mb and files "1,2,3,4,5" are total of 35mb. With the current code the dialog says: "Size: 45mb, 4 files, 0 subfolders" which is totaly misleading. What I want it to show is "size: 45mb, 9 files, 0 subfolders". There is nothing to do with Properties dialog as it calls something like: directorySizeJob->totalSize, directorySizeJob->totalFileCount, directorySizeJob->totalSubdirCount for the size label.


- Rahman


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviewboard.kde.org/r/463/#review686
-----------------------------------------------------------


On 2009-03-29 05:57:27, Rahman Duran wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://reviewboard.kde.org/r/463/
> -----------------------------------------------------------
> 
> (Updated 2009-03-29 05:57:27)
> 
> 
> Review request for kdelibs.
> 
> 
> Summary
> -------
> 
> Quote form bug report:
> 
> 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 addresses bug 171391.
>     https://bugs.kde.org/show_bug.cgi?id=171391
> 
> 
> Diffs
> -----
> 
>   trunk/KDE/kdelibs/kio/kio/directorysizejob.cpp 946358 
> 
> Diff: http://reviewboard.kde.org/r/463/diff
> 
> 
> Testing
> -------
> 
> Tested latest trunk.
> 
> 
> Screenshots
> -----------
> 
> The wrong behavior
>   http://reviewboard.kde.org/r/463/s/84/
> 
> 
> Thanks,
> 
> Rahman
> 
>





More information about the kde-core-devel mailing list