[Marble-devel] Network handling

Pino Toscano pino at kde.org
Sat Aug 30 01:15:06 CEST 2008


as a result of a recent kde-core-devel[1] discussion, it would be nice to have 
Marble using or the networking part more recent Qt technologies (like 
QNetworkAccessManager, introduced with Qt 4.4), or even KDE ones (just like 
the KPart integration).

My idea about that is the following: introduce a plugin structure (like 
MarbleRenderPlugin) to handle the HTTP jobs, and use it in 
HttpDownloadManager. In addition to that, also the current QHttp-base system 
would be a "plugin", but compiled built-in in marblewidget, and used as 
fallback when no other plugin is found/usable.

Small draft:
class NetworkPlugin
    virtual HttpJob* createJob(QUrl src, QString dest, QString id) = 0;

then also having HttpJob partially virtual (with eg execute() and 
prepareExecution(): this way, a network plugin has to:
- implement a NetworkPlugin subclass (can be quite trivial)
- specializing (by inheritance) its particular HttpJob

To accomplish that, a first step would be getting rid of HttpFetchFile, in 
favour of making HttpDownloadManager handle directly the HttpJob's; for this, 
a working (hopefully) patch is attached.
Second step would be creating a plugin structure, and decouple HttpJob in two: 
the abstract HttpJob and the QHttpHttpJob plugin (of course, still making 
things working after this).
Then, it comes writing plugins for QNetworkAccessManager and KIO.

Moreover: Torsten told be about the possibility to "reuse" connections, eg 
making keep-alive connections with QHttp, or "recycling" QHttp objects.
IMHO, this would be totally part of the internal logic of the plugin, that 
should create one or more "shared" objects, and pass them around to the 
particular HttpJob subtypes.

Ideas? Comments?

[1] http://markmail.org/message/e3k56aaglf23mzul
Pino Toscano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: marble-httpjob-merge.diff
Type: text/x-diff
Size: 8605 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/marble-devel/attachments/20080830/d0050a0f/attachment.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/marble-devel/attachments/20080830/d0050a0f/attachment.sig 

More information about the Marble-devel mailing list