KnewStuff: Get rid of KNS3 namespace, move widgets to their own module
Open, NormalPublic

Description

Currently we use the KNS3 namespace for the QWdigets & some other classes. However the number 3 does not make any sense in this context, since KnewStuff is part of KDE frameworks which has the major version 5 currently. In the kdelibs the namespace was changed from KNS to KNS3, because KNewStuff2 was still part of the kdelibs when KNewStuff3 was created.

For the widget components the namespace should be changed to KNSWidgets, most of the other classes of the KNS namespaces are already deprecated. All of the KNS3::Entry/EntryInternal/EntryWrapper stuff should get unified in KF6 and will get moved to KNSCore.

During KF5 the KNewStuff::Widgets module can already be introduced, https://invent.kde.org/frameworks/knewstuff/-/merge_requests/147 might be a good occasion to do so.
In addition to that we can create headers that use the KNSWidget/ prefix and create typedefs for compat in the headers. This way consumers can already adapt to the changes before KF6.

alex created this task.Nov 30 2021, 2:54 PM

i fully support this idea, and the plan as well. It will create a bit of temporary mess, but will also massively ease the transition come KF6 time, so yes, definitely let's do this :)

McPain added a subscriber: McPain.Nov 30 2021, 4:22 PM

I am here.

McPain added a comment.Dec 1 2021, 1:23 PM

Did the following steps:

  1. Moved KNS Widgets to separate library
  2. Moved Widgets source code to a subdirectory
  3. Moved KNS3::Widgets to a different namespace
  4. Moved KNS3::Entry{,Private} to KNSCore::

TODO:
Get source compatibility

alex added a comment.Jan 10 2022, 7:30 PM

For reference: The mentioned MR only touched the new class, https://invent.kde.org/frameworks/knewstuff/-/merge_requests/158/ adds some further KF6 compatibility code.

Because the KNS3::Button class has other issues already, I decided to copy the class. This is not a big deal since it is only a small wrapper around the KNS3::QtQuickDownloadWrapper.

alex triaged this task as Normal priority.Jan 10 2022, 7:30 PM
alex moved this task from Backlog to In Progress on the KF6 board.
alex moved this task from In Progress to Done on the KF6 board.Feb 19 2023, 6:51 PM