Skip to content
  • Dan Leinir Turthra Jensen's avatar
    Add KPackage support to KNewStuffCore · 3f38da8a
    Dan Leinir Turthra Jensen authored
    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
    3f38da8a