Replace KDE_open macro (and others)

Christian Ehrlicher Ch.Ehrlicher at gmx.de
Fri Feb 13 19:28:17 GMT 2009


Thiago Macieira schrieb:
> Christian Ehrlicher wrote:
>> Sébastien Renard schrieb:
>>> Le mardi 20 janvier 2009, Thiago Macieira a écrit :
>>>> The problem is when you get Unix filesystems from 10 years ago
>>>> (CD-ROM with Rock Ridge possibly; I think Joliet is Unicode), or if
>>>> you try to open a tarball / zip files created by tools that don't
>>>> encode in UTF-8. Those tools should be shot in the head.
>>> Slackware (at least 11.00) does not use UTF-8 as default install.
>> What does this mean? Is Slackware simply bad because they ignore the
>> advise to use utf-8 and I can still use QString or do I have to drop the
>> idea of using QString (don't have another idea so ...)
> 
> No. We just say default Slackware is not supported.
> 
> Use UTF-8, period.
> 
Ok, here the functions I would like to add:

----------------------------------8<-----------
namespace KDE
{
   /** replacement for ::chmod() to handle filenames in a platform 
independent way */
   KDECORE_EXPORT int chmod(const QString &path, mode_t mode);
   /** replacement for ::fopen()/::fopen64() to handle filenames in a 
platform independent way */
   KDECORE_EXPORT int fopen(const QString &filename, const char *type);
   /** replacement for ::link to handle filenames in a platform 
independent way */
   KDECORE_EXPORT int link(const QString &in, const QString &out);
   /** replacement for ::lstat()/::lstat64() to handle filenames in a 
platform independent way */
   KDECORE_EXPORT int lstat(const QString &path, KDE_struct_stat *buf);
   /** replacement for ::mkdir() to handle pathnames in a platform 
independent way */
   KDECORE_EXPORT int mkdir(const QString &pathname, mode_t mode);
   /** replacement for ::open()/::open64() to handle filenames in a 
platform independent way */
   KDECORE_EXPORT int open(const QString &pathname, int flags, mode_t 
mode = 0);
   /** replacement for ::rmdir() to handle pathnames in a platform 
independent way */
   KDECORE_EXPORT int rmdir(const QString &pathname);
   /** replacement for ::remove() to handle pathnames in a platform 
independent way */
   KDECORE_EXPORT int remove(const QString &pathname);
   /** replacement for ::rename() to handle pathnames in a platform 
independent way */
   KDECORE_EXPORT int rename(const QString &in, const QString &out);
   /** replacement for ::rmdir() to handle pathnames in a platform 
independent way */
   KDECORE_EXPORT int rmdir(const QString &pathname);
   /** replacement for ::stat()/::stat64() to handle filenames in a 
platform independent way */
   KDECORE_EXPORT int stat(const QString &path, KDE_struct_stat *buf);
   /** replacement for ::symlink() to handle filenames in a platform 
independent way */
   KDECORE_EXPORT int symlink(const QString &in, const QString &out);
   /** replacement for ::unlink() to handle filenames in a platform 
independent way */
   KDECORE_EXPORT int unlink(const QString &pathname);
   /** replacement for ::utime() to handle filenames in a platform 
independent way */
   KDECORE_EXPORT int utime(const QString &filename, struct utimbuf *buf);
};
----------------------------------8<-----------

I would like to add them to kde_file.h. For unix it's only a wrapper 
therefore I think it's maybe worth inlining those functions - but the 
kde policy doesn't like inlining :) What do you think?


Christian




More information about the kde-core-devel mailing list