KNewStuff: Unify KNSCore::Engine and QuickEngine
Open, NormalPublic

Description

The current way of having a dedicated engine for the QML logic causes quite a bit of extra code, enum duplication and forces us to keep the API design of the two engines in sync. Also some if the QuickEngine's signals do not contain as much information as the ones from the code engine.
Because of that we sometimes have to call engine.engine to get the core engine, which is quite confusing API.

This involves:

  • Unifying/standardizing API that is different from the engine
  • Moving copied enums to classes where they originally belong
  • Moving the properties from the QuickEngine to KNSCore::Engine

The QuickEngine is only loaded as a plugin, consequently we only have to worry about source-code compat.

alex created this task.Jan 6 2022, 12:53 PM
alex triaged this task as Normal priority.
aleasto removed aleasto as the assignee of this task.Jan 6 2022, 1:04 PM
aleasto added a subscriber: aleasto.
aleasto removed a subscriber: aleasto.
alex claimed this task.Jan 6 2022, 1:13 PM
alex added a comment.Jan 6 2022, 2:43 PM

@leinir Should we register the EntryInternal class with it's enums under the org.kde.newstuff uri? While it it part of the core package, I consider it useful for a lot of consumers.

We register some classes under the org.kde.newstuff.core uri, but that is only used by internal stuff, like the QuestionAsker or ErrorDisplayer.

We couldn't do it at the time, primarily because of how some things in KNSQuick is wrapping Core things, and it'd end up terribly confusing if some things were actually the literal things from Core, and some things were things that wrapped things from Core but wasn't actually those things. Still think that that logic is fairly sound, and it's perhaps also important to note that turning EntryInternal into a QObject has some pretty wide-reaching consequences. Not that it's not something we should do, but it's not at all trivial... Mostly to warn you, making it happen would be great, but don't want you trying to dig into that without having enough headache tablets in stock ;)

alex added a comment.Jan 12 2022, 7:42 PM

making it happen would be great, but don't want you trying to dig into that without having enough headache tablets in stock ;)

it is actually pretty simple using Q_GADGET: https://invent.kde.org/frameworks/knewstuff/-/merge_requests/162. No headache tablets, just a small coffee needed :D

This way we don't need to make it a QObject and have the BIC and performance implications of that.

alex moved this task from Backlog to Waiting on Other Tasks on the KF6 board.Apr 9 2023, 6:00 PM