activation thought
Waldo Bastian
bastian@kde.org
Wed, 15 Oct 2003 12:02:38 +0200
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Wednesday 15 October 2003 07:50 am, Havoc Pennington wrote:
> Hi,
>
> Summary of KDE activation from the docs, people with a clue please
> correct me: a query language for locating .desktop files. But desktop
> files can point to shared libraries or DCOP services, not only
> executables.
>
> http://developer.kde.org/documentation/library/3.1-api/kio/html/classKServi
>ce.html
> http://developer.kde.org/documentation/library/3.1-api/kio/html/classKTrade
>r.html
> http://developer.kde.org/documentation/library/kdeqt/tradersyntax.html
>
> Essentially KTrader can run queries, and queries return a KService which
> is basically the same as GnomeDesktopItem, i.e. a .desktop file
> representation.
>
> An interesting thing about this is that it uses the same implementation
> (file format, query language, ksycoca cache) for all activation, but
> there are several different kinds of things to be activated.
That's fairly accurate.
Basically everything that can be activated is a KService. Each KService is
described by a .desktop file. The kind of service a KService provides is
described by KServiceType. A particular KService implements one or more
KServiceTypes. The "Application" KServiceType is the most obvious one, it
represents an executable that is typically shown in the menu.
KMimeType is a specialisation of KServiceType for the purpose of file
handling. It conveys the message "this service is able to handle files of the
mimetype foo/bar"
The service types of a typical application able to handle foo/bar files would
be "Application;foo/bar;"
A common servicetype other than "Application" is "KParts/ReadOnlyPart", which
basically indicates a KPart that can be embedded in Konqueror.
The service types of such KPart could be "KParts/ReadOnlyPart;foo/bar;"
Note that KTrader doesn't actually do the activation itself, it just tells you
about the available services (in order of user preference). For out-of-
process services (executables) klauncher can do the activation. For in-
process services (DSOs) KLibLoader / KLibFactory provides methods for
creating the required objects.
Cheers,
Waldo
- --
bastian@kde.org -=|[ SUSE, The Linux Desktop Experts ]|=- bastian@suse.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org
iD8DBQE/jRs+N4pvrENfboIRApl/AJ9YSaycHfrnobizzaFyZ/DDtSi9mQCfXTCC
4TS0PPf+9forzWYRacxJrEs=
=I9/u
-----END PGP SIGNATURE-----