Move KOverlayIconPlugin to KIOCore
Open, Needs TriagePublic

Description

https://lxr.kde.org/ident?v=kf5-qt5&_i=KOverlayIconPlugin

We do not provide this in any KDE code, but third parties do. To avoid lots of the KIOWidgets dependencies, we can move this class to KIOCore.

alex created this task.Jun 2 2021, 9:11 AM
alex added a comment.Jun 2 2021, 11:03 AM

Interesting, is there any reason it does not use KPluginfactory like the rest of KDE does?

And considering that it is only used in dolphin could it make sense to move it there?

Makes sense, unless we want those overlays to show up in the file dialog too, in the future...

alex added a comment.Jul 1 2021, 11:45 AM

I don't see how that is currently the case, also similar to T12174 I think from a dependency POV it does not seem desirable for most consumers.

alex renamed this task from Investigate if KOverlayIconPlugin class is needed to Move KOverlayIconPlugin to dolphin.Jul 1 2021, 11:45 AM
alex moved this task from Backlog to Waiting on KF6 Branching on the KF6 board.

Keep in mind that there are more file managers than Dolphin. There's at least Krusader and Index. No idea whether they use this, but it's not that far fetched

alex added a comment.Jul 1 2021, 6:19 PM

It might be worth noting that the code which loads/uses the plugins (KFileItemModelRolesUpdater class) is also purely dolphin internal.

No idea whether they use this, but it's not that far fetched

No they don't, I checked that with an lxr search before creating this task.

What do we gain by removing it from KIO?

alex added a comment.Jul 19 2021, 5:01 PM

Then it would be moved to the only place it is used: Dolphin. This way KIO will be lighter. Also it seems like the header does not contain any KIO specific classes, if we move it to dolphin one would only need to depend on the dolphin headers & Qt instead of KIO and it's dependencies.

alex added a comment.Feb 14 2023, 4:58 PM

As discussed in the weekly, KIO feels like a weird place, but there isn't any better one.
The class should be moved from KIOWidgets to KIOCore to make life easier for third parties that provide such a plugin

meven added a comment.Feb 15 2023, 8:43 AM

KAbstractFileItemActionPlugin and KFileItemActions should be considered as well then.

meven added a comment.Feb 15 2023, 8:51 AM

KRecentDirs seem like an old features that can be removed.
As far I can tell, its only user is KFileWidget which has never a "m_fileclass" set which is necessary for its feature to work.

We have KRecendDocument and KActivitiesStats that can provide alternative feature.

alex renamed this task from Move KOverlayIconPlugin to dolphin to Move KOverlayIconPlugin to KIOCore.Feb 15 2023, 9:38 AM
alex updated the task description. (Show Details)
alex added a comment.Feb 15 2023, 9:47 AM

KAbstractFileItemActionPlugin and KFileItemActions should be considered as well then.

No, those are used in other places like plasma as well.

As far I can tell, its only user is KFileWidget which has never a "m_fileclass" set which is necessary for its feature to work.

that is not true, please see the code in KFileWidgets:
QUrl KFileWidget::getStartUrl(const QUrl &startDir, QString &recentDirClass, QString &fileName)
Here we get the value by reference and assign it within the function.

In T14538#287784, @alex wrote:

As far I can tell, its only user is KFileWidget which has never a "m_fileclass" set which is necessary for its feature to work.

that is not true, please see the code in KFileWidgets:
QUrl KFileWidget::getStartUrl(const QUrl &startDir, QString &recentDirClass, QString &fileName)
Here we get the value by reference and assign it within the function.

I stand corrected ;-)

alex moved this task from In Progress to Done on the KF6 board.Feb 17 2023, 3:52 PM