Replace KDE_open macro (and others)

Christian Ehrlicher Ch.Ehrlicher at gmx.de
Tue Jan 20 05:33:51 GMT 2009


David Faure schrieb:
> On Monday 19 January 2009, Christian Ehrlicher wrote:
>> Hi,
>>
>> now that trunk is open again I would like to renew my suggestion to 
>> replace KDE_foo macros from kde_file.h with proper functions. 
> 
> (of course "replace" doesn't mean removing the current macros,
> for source/binary compatibility reasons).
> 
yes, for sure
>> As Thiago already set I would replace const char* filename with QUrl --> KDE::open 
>> (const QUrl &filename, ...). This would fix the problems with unicode 
>> filenames on windows (currently you can't open files with unicode 
>> characters which are not in the current locale codeset).
> 
> This sounds awfully slow to me, and incoherent.
> KDE::open(path) is only for local paths, so a const QString& path or a const QByteArray& path would be right.
> If you pass a QUrl, what happens when the QUrl contains http://www.kde.org or ftp://ftp.kde.org/index.html?
> Nothing, of course, but then the API is really confusing ("we have all this API in KIO that takes
> urls and can work with them, and we have this API like KDE::open which also takes urls
> but cannot work with them unless they are local paths").
> 
> I can see how QString is a bad choice for paths - Thiago had the utopia that 
> everyone would be using UTF-8 by now :-) ... but then the right choice is
> QByteArray IMHO, not QUrl... Of course the issue is how to put the right stuff
> into the bytearray, especially now that everything everywhere is using QString
> for paths. Even QUrl::toLocalFile(), BTW...
> 
> Seems to me that proper support for this can only be done in Qt 5....
> 
I don't care if we use QString or QUrl but QByteArray is completly wrong.


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/20090120/e7620a99/attachment.sig>


More information about the kde-core-devel mailing list