D8636: Add support for downloading the 2nd or 3rd download link from a kde store product when fetching lookandfeel dependencies
Chris Holland
noreply at phabricator.kde.org
Fri Nov 3 05:54:43 UTC 2017
Zren created this revision.
Restricted Application added a project: Frameworks.
Restricted Application added a subscriber: Frameworks.
REVISION SUMMARY
Implementing the feature request in BUG #385429.
https://bugs.kde.org/show_bug.cgi?id=385429
LookAndFeels introduced the ability to set dependencies, that are downloaded first before installing the look and feel package.
https://userbase.kde.org/Plasma/Create_a_Look_and_Feel_Package
Eg: X-KPackage-Dependencies=kns://plasmoids.knsrc/api.kde-look.org/1160672
It will call:
/usr/lib/x86_64-linux-gnu/libexec/kf5/kpackagehandlers/knshandler kns://plasmoids.knsrc/api.kde-look.org/1160672
Previously this file called `engine.install(entry);`
the second argument (`linkId`) isn't supplied so it defaults to 1.
void install(KNSCore::EntryInternal entry, int linkId = 1);
This means it downloads the first link, which for me is the oldest version of the widget typically.
https://api.kde-look.org/ocs/v1/content/download/1160672/1
tells it to download tiledmenu-v05-kde5.5.plasmoid
while
https://api.kde-look.org/ocs/v1/content/download/1160672/3
tells it to download the latest version tiledmenu-v18-kde5.9.plasmoid
This patch adds the ability to specify which link to download in the 3rd path section.
Eg: `kns://plasmoids.knsrc/api.kde-look.org/1160672/3`
TEST PLAN
Shorten the command call for testing since knshandler isn't in `$PATH`.
alias knshandler='/usr/lib/x86_64-linux-gnu/libexec/kf5/kpackagehandlers/knshandler'
knshandler kns://plasmoids.knsrc/api.kde-look.org/1160672
// Installs tiledmenu-v05-kde5.5.plasmoid
knshandler kns://plasmoids.knsrc/api.kde-look.org/1160672/2
// Should error, since we didn't uninstall the previous version. Should log:
// Command ' "kpackagetool5 --install /tmp/tiledmenu-v05-kde5.5.plasmoid --type Plasma/Applet" ' failed with code 4
/tmp/tiledmenu-v05-kde5.5.plasmoid
knshandler kns://plasmoids.knsrc/api.kde-look.org/1160672/2
// Should error, since we didn't uninstall the previous version. Should log:
// Command ' "kpackagetool5 --install /tmp/tiledmenu-v11-kde5.6.plasmoid --type Plasma/Applet" ' failed with code 4
knshandler kns://plasmoids.knsrc/api.kde-look.org/1160672/3
// Should error, since we didn't uninstall the previous version. Should log:
// Command ' "kpackagetool5 --install /tmp/tiledmenu-v18-kde5.9.plasmoid --type Plasma/Applet" ' failed with code 4
knshandler kns://plasmoids.knsrc/api.kde-look.org/1160672/3
// Should error, since we didn't uninstall the previous version. Should log:
// Command ' "kpackagetool5 --install /tmp/tiledmenu-v18-kde5.9.plasmoid --type Plasma/Applet" ' failed with code 4
knshandler kns://plasmoids.knsrc/api.kde-look.org/1160672/test
// linkId is not an integer QUrl("kns://plasmoids.knsrc/api.kde-look.org/1160672/test") ("api.kde-look.org", "1160672", "test")
knshandler kns://plasmoids.knsrc/api.kde-look.org/1160672/2/test
// wrong format in the url path QUrl("kns://plasmoids.knsrc/api.kde-look.org/1160672/2/test") ("api.kde-look.org", "1160672", "2", "test")
knshandler kns://plasmoids.knsrc/api.kde-look.org/
// wrong format in the url path QUrl("kns://plasmoids.knsrc/api.kde-look.org/") ("api.kde-look.org")
REPOSITORY
R252 Framework Integration
REVISION DETAIL
https://phabricator.kde.org/D8636
AFFECTED FILES
src/kpackage-install-handlers/kns/main.cpp
To: Zren
Cc: #frameworks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20171103/eb656a4f/attachment.html>
More information about the Kde-frameworks-devel
mailing list