[Patch] Usage of URL's filename to detect hidden files

David Faure faure at kde.org
Wed Mar 17 17:09:19 GMT 2004

On Wednesday 17 March 2004 16:30, Craig Drummond wrote:
> Hi,
> Currently it seems as if KDE just uses a KFileItem's "name" field to
> determine if a file is hidden or not. However, a KFileItem can also have a URL,
> whose filename part may differ. The following patches add a "isHidden()" function
> to KFileItem - this function then uses the url.filename() (if one has been
> specified) to look for a leading '.'
> Is this OK to apply?

I like the idea of the isHidden() method, but I'm not sure about its implementation :)

When does your problem happen? You have an item with a leading dot in the filename
but no leading dot in the text? Doesn't this mean that the ioslave returning this
would actually want this item to show up, and would use a leading dot in the _name_
(which is the visible part), if it wanted the item to be hidden?

About the current implementation: in KFileItem, m_url is never empty, is it? 
I don't see how it could be (other than passed empty to the ctor, but what for?).
This wouldn't make much sense.

David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).

More information about the kde-core-devel mailing list