RFC: On-demand package installation API in kdelibs

Sune Vuorela nospam at vuorela.dk
Wed Jul 28 20:07:11 BST 2010


On 2010-07-28, Lubos Lunak <l.lunak at suse.cz> 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.

trying to comment on a api you actually don't think should exist, but
well. trying anyway.

It should provide info about
 - who wants a feature
 - why is the feature wanted
 - what feature is wanted.

if it should be a function:

enum featurekind {
    Executable,
    MimeType,
    Plugin,
    DebugInfo
    //To be extended
};

void tryProvide(const QString& appname, const QString& explanation, 
                featurekind, const QString& feature);

and a app could do something like:

tryProvide("MyFancyBrowser", QString("In order to show %1, a extra
plugin is needed").arg("moonlight videos"), Plugin, "moonlight.so");

or alternatively

tryProvide("MyFancyBrowser", QString("In order to show %1, a extra
plugin is needed").arg("moonlight videos"), MimeType,
"application/x-silverlight");


I don't think the return type of the function actually is important,
because the app should handle it gracefully anyways if it doesn't exist.
(handling it gracefully can in worst case be calling exit();, but then
the distribution people is having a issue, and maybe shouldn't ship the
app in question).
Or maybe, the function should be bool: wether or not anything has
changed on the system and if diagnostics should be rerun.


And it should be noted, that this should not be a replacement for
distriution packagers to actually do their job.



/Sune





More information about the kde-core-devel mailing list