KF6 applet porting: declarative QML replacements for DataEngines?

2024-02-23 Thread Adam Fontenot
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


Re: DataSource and DataEngine documentation unavailable

2024-11-18 Thread Adam Fontenot
On Sun, Nov 17, 2024 at 12:37 PM Amelia Harris  wrote:
>
> so whats the deal with that, im currently using the WaybackMachine to view 
> the pages, is there a reason why they were removed? I cannot find any 
> documentation for either datasource or dataengine on api.kde.org. These two 
> pages are missing, and are available on the internet archive:
> https://api.kde.org/frameworks/plasma-framework/html/classPlasma_1_1DataEngine.html
> https://api.kde.org/frameworks/plasma-framework/html/classPlasma_1_1DataSource.html
>
> have these been removed or just moved, and haven't had a redirect set up?

Hi Amelia,

I had the same question a while back and unfortunately didn't get any
responses:
https://mail.kde.org/pipermail/kde-devel/2024-February/002460.html

My understanding is that support for these features was deprecated as
part of KF6 and no longer supposed to be used for new development, but
it's not always clear what the intended replacement is supposed to be.
In general if you have legacy code you can use the Plasma5Support
library, which appears briefly in the documentation here:
https://develop.kde.org/docs/plasma/widget/porting_kf6/#new-plasma5support-library

Sorry if that's not super helpful, this is just what my experience was
when porting an applet to KF6.


Best,
Adam