KIO split (from the Job side)

Kevin Ottens ervin at kde.org
Mon Apr 17 17:47:48 BST 2006


Hello list,

I'd like to propose some refactoring in the KIO::Job area. It's in my opinion 
particularly needed for the following reasons:
1) KIO::Jobs are tied to the UI and this depend could be removed
2) Other areas than KIO are starting to use Jobs (namely Akonadi and Solid), 
so it's a good target for factoring

My current plan is the following:

1) Factor out a KJob class that will go in kdecore (find in attachment).
I already have a first version of this class. It provides the necessary 
interface to implement a job and track its progress, but doesn't enforce any 
scheduling policy.
The major drawback is that some signals signature changed which means quite 
some changes in the user code. I already have modified the whole kdelibs to 
use the new signals (I didn't attach the patch since it's big around 160KB). 
kdebase requires a similar search and replace work.
Of course there's several advantages, KJob is UI free and we'll have a common 
job interface accross whole KDE.

Note that currently KJob doesn't support subjobs, I kept this in KIO::Job but 
it could be moved if necessary.

2) Factor out the UI parts of KIO::Job.
That's the natural second step for such a refactoring... KJob being UI free we 
need to reuse the UI features of KIO::Job.
The showErrorDialog(), and window()/setWindow() methods would be removed from 
KIO::Job and go in a kdeui counterpart of KJob.
The KIO::Observer class would move to kdeui after removing the KIO specific 
bits and putting them in convenience classes.
In the end it means that we'll be able to use the uiserver for any job inside 
of KDE.

If no one objects I'll commit KJob and the necessary kdelibs modification on 
wednesday. In the mean time I'll start working on porting kdebase to the new 
KJob signal signatures.

Of course, opinions and comments are welcome.

Regards.
-- 
Kévin 'ervin' Ottens, http://ervin.ipsquad.net
"Ni le maître sans disciple, Ni le disciple sans maître,
Ne font reculer l'ignorance."
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kjob.cpp
Type: text/x-c++src
Size: 3624 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20060417/c29da598/attachment.cpp>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kjob.h
Type: text/x-c++hdr
Size: 8601 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20060417/c29da598/attachment.h>


More information about the kde-core-devel mailing list