Problems with KDE_stat on systems where the default locale is not utf-8

Christian Ehrlicher Ch.Ehrlicher at
Sun Nov 30 20:15:19 GMT 2008

Thiago Macieira schrieb:
> On Thursday 20 November 2008 09:11:22 Christian Ehrlicher wrote:
>>> The Qt API will. Or, alternatively, the Win32 API will (the *W
>>> functions).
>> How fast is QFileInfo in Qt4.5? If it's too slow I'm still for a new small
>> wrapper class for local files inside KDE to handle stat() and others.
>> Adding ifdefs everywhere isn't a nice solution at all.
> No improvement.
> The problem is systematic and can't be improved. It can only be made faster by 
> ditching the file engine support we added in older versions of Qt. That is, 
> only for Qt 5.
I would like to add some new functions to kde_file.h - if possible 
before 4.2 so we can handle non-encodeable filenames on windows.

namespace KDE
   KDECORE_EXPORT int chmod(const QString &path, mode_t mode);
   KDECORE_EXPORT int link(const QString &in, const QString &out);
   KDECORE_EXPORT int lstat(const QString &path, KDE_struct_stat *buf);
   KDECORE_EXPORT int mkdir(const QString &pathname, mode_t mode);
   KDECORE_EXPORT int open(const QString &pathname, int flags);
   KDECORE_EXPORT int open(const QString &pathname, int flags, mode_t mode);
   KDECORE_EXPORT int rmdir(const QString &pathname);
   KDECORE_EXPORT int remove(const QString &pathname);
   KDECORE_EXPORT int rename(const QString &in, const QString &out);
   KDECORE_EXPORT int stat(const QString &path, KDE_struct_stat *buf);
   KDECORE_EXPORT int symlink(const QString &in, const QString &out);
   KDECORE_EXPORT int unlink(const QString &pathname);
   KDECORE_EXPORT int utime(const QString &filename, struct utimbuf *buf);
Maybe I forgot some but for now that were all I needed to compile kdelibs.

If you think this will slow down file I/O I can inline most of the 
functions (at least for unix it's only a replacement for 
::foo(QFile::encodeName(path)) ).


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 258 bytes
Desc: OpenPGP digital signature
URL: <>

More information about the kde-core-devel mailing list