KIO::NetAccess static methods question

Rafael Fernández López ereslibre at kde.org
Mon Oct 22 20:13:39 BST 2007


> Sure, just pointing a solution to make it more bearable, sorry for trying
> to help. :-p

Hehe, I hope you didn't get my reply as "rude" as rereading it again it could 
have sound like that. I didn't pretend it.

> It's a sync API, your application will sit where the call happened, making
> it unusable...

Got from the documentation:
   * [...] The functions appear to be blocking,
   * but the Qt event loop continues running while the operations
   * are handled. This means that the GUI will not freeze. [...]

> Sure, and guess what? It's not using KIO::NetAccess but KIO::Job.

That was very easy to deduce from the implications :)

> Which is fine, NetAccess is the 'easy sync call' API, if you want more
> control use KIO::Job (moreover KIO::Job even have exec() now, so you can
> still shoot yourself in the foot, ensuring there's no progress UI and then
> blocking until the job is done).

My main point is: we have a sync and async interfaces. The async interface 
already give some options for showing or not progress dialogs, why the sync 
one doesn't ? We could say: well, they are sync operations, there should be a 
progress dialog always, but we can make life easier to the developer by 
adding a parameter to the signature of the methods for allowing special 
operations (as Overwrite [as on KIO::Jobs now], HideProgress, etc...).

I think that all jobs (the sync, async, those for mask net operations into 
KIO::, and all of them) should have the same interface, for being consistent 
system-wide. I think almost all developers that don't want to write more will 
prefer a parameter added with flags than reimplementing a job class for 
certain behaviors that can be given as I said, almost for free.


-- 
Rafael Fernández López

GPG Fingerprint: B9F4 4730 43F8 FFDD CC5E BA8E 724E 406E 3F01 D070
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20071022/bd07f3dc/attachment.sig>


More information about the kde-core-devel mailing list