KF6 applet porting: declarative QML replacements for DataEngines?

Adam Fontenot adam.m.fontenot at gmail.com
Fri Feb 23 23:03:08 GMT 2024


Hi all,

I recently ported an applet [1] from KF5 to KF6. As part of this, I
changed a PlasmaCore.DataSource to Plasma5Support.DataSource. This
data engine provides a source model for a KSortFilterProxyModel,
which feeds a ScrollView.

The README for the Plasma5Support project [2] says

> Dataengine support is not in the kf6 version of plasma anymore.
Dataengines should be migrated to QML imports...

Additionally, [3] describes them as "a piece of tech from the KDE4
era", and says "we don't promise compatibility throughout Plasma 6".

I'm wondering whether these statements are supposed to apply to
applet developers (at least for new development), and if so, whether
there is guidance on appropriate declarative replacements for the
various engines. Is there a Phabricator task for exposing the models
in the various engines to QML? Do applet developers need to worry
about API breakage during the Plasma 6 era?

To be specific, I'm using the "places" engine, which exposes data
from KIO's KFilePlacesModel. [4] Looking at the various official
Plasma applets that use this model, they appear to be bikeshedding
their own C++ implementations, e.g. [5] for the folder applet, or
[6] for Kickoff / Kicker.

Best,
Adam

[1] https://github.com/dfaust/plasma-applet-places-widget
[2] https://invent.kde.org/plasma/plasma5support
[3] https://phabricator.kde.org/T13315
[4] https://api.kde.org/frameworks/kio/html/classKFilePlacesModel.html
[5] https://invent.kde.org/plasma/plasma-desktop/-/blob/master/containments/desktop/plugins/folder/placesmodel.cpp
[6] https://invent.kde.org/plasma/plasma-workspace/-/blob/master/applets/kicker/plugin/computermodel.cpp


More information about the kde-devel mailing list