KDE is not an OS platform... (And neither is Gnome)

David Faure faure at kde.org
Wed Nov 4 00:14:58 GMT 2009


On Wednesday 04 November 2009, Christoph Feck wrote:
> On Wednesday 04 November 2009 00:23:04 nf2 wrote:
> > Qt in particular, because it lacks an async file-IO API.
> 
> QIODevice (the class which QFile inherits from) is asynchronous,
> at least API-wise.

But only API wise.
QFile doesn't emit readyRead like a socket does. It just doesn't make sense
in the "common case" (local files).
Do we really want to port every QFile usage to be socket-like code,
with signals and slots?

The way it is right now is quite clear and simple. We use QFile when we are 
working with files that we know to be local. KConfig files, desktop files, 
bookmarks file, app-specific data files in kdehome, etc. Anything out of 
KStandardDirs, basically. For everything else, i.e. for user-specific files, we 
use KUrl and KIO. Different API, different behavior, and for a very good reason: 
because these are remote, therefore potentially slow, therefore you need to go 
back to the event loop i.e. do it all asynchronously. You can't fix every 
problem in the house with a hammer :-)

What do we gain, API wise, from having a QFile that emits readyRead(), 
compared to a KIO::TransferJob that emits data()? I just don't get it.
It doesn't help KDE apps, and it doesn't help non-Qt apps, so it only helps 
Qt-only apps!? I don't think this is what this discussion was about,
since Qt-only apps represent only a little piece of a unified VFS dream.

-- 
David Faure, faure at kde.org, http://www.davidfaure.fr
Sponsored by Nokia to work on KDE, incl. Konqueror (http://www.konqueror.org).




More information about the kde-core-devel mailing list