Questions on the new KIO::FileJob API

David Faure faure at kde.org
Mon May 5 14:14:40 BST 2008


On Saturday 03 May 2008, Thiago Macieira wrote:
> nf2 wrote:
> >1) - Creating Files: Apparently FileJob in kio_file doesn't allow
> >creating files. As there is no QIODevice::Create flag in the
> >QIODevice::OpenMode enum, it should probably create the file on
> >QIODevice::WriteOnly. Although i believe it would be good to have a
> >QIODevice::Create flag which prevents overwriting by mistake. Please
> >have a look at the GIO GFile API also...
> 
> It was probably not conceived for creating files. If you're going to 
> create one, use KIO::put.

He meant at the QIODevice API level. The API doesn't include a Create flag because,
well, most of the time when we use WriteOnly we are fine with creating the file :)

Obviously FileProtocol::open does the same, it creates when called with QIODevice::WriteOnly.
I don't see a big problem there. (and neither QIODevice nor the meaning of existing methods in SlaveBase can change now anyway).

-- 
David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).




More information about the kde-core-devel mailing list