[Patch] - Port kded/vfolder_menu.cpp to QDirIterator

Christian Ehrlicher Ch.Ehrlicher at gmx.de
Mon Feb 23 17:08:36 GMT 2009


David Faure schrieb:
> On Sunday 22 February 2009, Christian Ehrlicher wrote:
>> Hi,
>>
>> attached you can find a patch to port vfolder_menu.cpp to QDirIterator 
>> to resolve possible problems with filename encodings on windows.
>>
>> I'm unsure about ::stat(), S_ISREG ( buff.st_mode ) <-> 
>> QFileInfo::isFile() when a file is a symlink. Maybe someone can take a 
>> look on it if I did it right.
> 
> stat() follows symlinks (unlike lstat), so stat+S_ISREG would say true
> for a symlink-to-a-file (and false for a symlink-to-a-dir).
> But QFileInfo::isFile() works exactly the same way, so no problem, just
> test for isFile(), no need for isSymLink().
> 
> On that note, please make sure symlinks to dirs are followed too.
> That's what the DT_LNK was added for. Bug 150307.
> 
According to the docs isDir() should also recognize symlinks:
"Returns true if this object points to a directory or to a symbolic link
to a directory"

Christian

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 258 bytes
Desc: OpenPGP digital signature
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20090223/0b200302/attachment.sig>


More information about the kde-core-devel mailing list