RFC: On-demand package installation API in kdelibs
Kevin Krammer
kevin.krammer at gmx.at
Thu Jul 29 09:54:01 BST 2010
On Wednesday, 2010-07-28, Lubos Lunak wrote:
> So the idea is to provide simple API in the form of 'bool
> tryToEnsureInstalled{MimeType|Binary|Whatever}( QString name )'. Various
> KDE code will call it when it finds out something is missing and maybe the
> call solves the problem.
While I like the idea of making it easy for developers to incorporate such a
feature, I am afraid that this stile of API is simplified to much.
Installing things, especially when potentially involving downloading, is
inherently asynchronous.
So such an easy method either returns immediately and provides some kind of
status signalling or it uses nested event loops.
At KDEPIM we've run into numerous nasty side effects when trying to shoehorn
asynchronous behavior into synchronous APIs.
Our lesson learned was to never to that again even if making a job based API
(or something like QTcpSocket's start-and-signal-finish) is more work and not
as trivial to use until you get used to it.
Cheers,
Kevin
--
Kevin Krammer, KDE developer, xdg-utils developer
KDE user support, developer mentoring
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20100729/5a40fd21/attachment.sig>
More information about the kde-core-devel
mailing list