Add KPackage support to KNewStuffCore

Authored by leinir on May 4 2020, 9:56 AM.

Description

Add KPackage support to KNewStuffCore

Summary:
Adding support for KPackage directly to KNewStuff means that we are
able to deal more gracefully with things like Plasma's Global Themes
(and indeed any other kpackage based thing).

This is done by adding another archive specialisation to the installer
class, and by also adding a check to the cache to ensure that even
when a kpackage is removed from the system outside of KNewStuff,
it does not remain seemingly installed in the KNS lists.

  • Make sure the cache gets written periodically
  • Add KPackage support to KNSCore::Installation
  • Introduce a getter (and enum) for the uncompress Installation setting
  • Add a redirection to the knsrc documentation location
  • Add a function to clean the cache of functionally stale entries
  • Clean the cache when the uncompression method is set to kpackage
  • Add a fallback for unconverted kpackage based knsrc files
  • Clean up some of the error reporting, and reset the entry's state
  • Check if installedFile is a file, if so bypass KPackage and delete
  • Add a KPackageType property to Installation, for fallback purposes
  • Add documentation for the new knsrc bits
  • Handle adopting an already installed kpackage item
  • Also uninstall not-adopted-but-there possibly installed kpackage bits
  • Add a simple async job wrapper for KPackage operations (and use it for the installation handling tasks in Installation)

BUG:418466

Test Plan:
There are two options for testing out this patch:

  1. Use an existing knsrc file which uses kpackage installation (such as plasma themes), which will use the fallback
  2. Manually convert such a knsrc file, by removing the uninstall and installation commands from the knsrc file, and adding in an "Uncompress=kpackage" line instead

Both these should result in the KPackage path being used. You should see this on the command line when attempting to install an item, resulting in lines like "Using KPackage for installation", as well as more pleasant error reporting in the UI in the cases where something goes wrong.

To turn on debug output for KNewStuffCore, add QT_LOGGING_RULES="org.kde.knewstuff*=true" to your command line. For example, you can launch the test dialogue directly by launching the following from your build directory:

QT_LOGGING_RULES="org.kde.knewstuff*=true" ./bin/khotnewstuff-dialog plasma-themes.knsrc

Reviewers: Plasma, KNewStuff, Frameworks, ngraham, mart, davidedmundson, broulik, bshah

Reviewed By: Plasma, mart

Subscribers: alex, ngraham, kde-frameworks-devel

Tags: Frameworks

Differential Revision: https://phabricator.kde.org/D28701

Details

Committed
leinirMay 4 2020, 10:45 AM
Reviewer
Plasma
Differential Revision
D28701: Add KPackage support to KNewStuffCore
Parents
R304:293c87dc2b17: GIT_SILENT Upgrade ECM and KF5 version requirements for 5.70.0 release.
Branches
Unknown
Tags
Unknown