This forum has been archived. All content is frozen. Please use KDE Discuss instead.

UDSEntry size not correct?

Tags: None
(comma "," separated)
fluca1978
Registered Member
Posts
81
Karma
0
OS

UDSEntry size not correct?

Thu Apr 26, 2012 2:53 pm
Hello,
I've got a little problem with a few UDSEntry that represent virtual folders: in my code I place a size for each entry like the following but when I right click on the folder from konqueror and ask for the folder size it always displays zero bytes.

Code: Select all
UDSEntry entry;
...
entry.insert( KIO::UDSEntry::UDS_SIZE,  2000 );


I've checked that the value (2000) in this case is effectively placed into the UDSEntry. Am I misunderstanding the size attribute?
dfaure
KDE Developer
Posts
14
Karma
0
OS

Re: UDSEntry size not correct?  Topic is solved

Sat Apr 28, 2012 9:59 pm
The size of a folder (as shown in the properties dialog) is the sum of the size of all the contents of the folder.

Not UDS_SIZE, which is the size of the item itself, which makes no sense for folders (e.g. on an ext3 filesystem, a folder entry takes 1K or 2K or 4K on disk, as shown by ls -l, but the user doesn't really care about that, so konqueror/dolphin doesn't display that).

You should check whether listDir is correctly implemented, and whether files themselves have a UDS_SIZE -- that's what kpropertiesdialog sums up.

If you only display folders, no files, then there's a problem indeed ;-)
Maybe KIO itself can be changed to take into account UDS_SIZE for folders, after double-checking that none of the existing kioslaves set that...


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Evergrowing, Google [Bot], ourcraft