<table><tr><td style="">Zren created this revision.<br />Restricted Application added a project: Frameworks.<br />Restricted Application added a subscriber: Frameworks.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D8636" rel="noreferrer">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>Implementing the feature request in BUG #385429.<br />
<a href="https://bugs.kde.org/show_bug.cgi?id=385429" class="remarkup-link" target="_blank" rel="noreferrer">https://bugs.kde.org/show_bug.cgi?id=385429</a></p>

<p>LookAndFeels introduced the ability to set dependencies, that are downloaded first before installing the look and feel package.<br />
<a href="https://userbase.kde.org/Plasma/Create_a_Look_and_Feel_Package" class="remarkup-link" target="_blank" rel="noreferrer">https://userbase.kde.org/Plasma/Create_a_Look_and_Feel_Package</a></p>

<p>Eg: X-KPackage-Dependencies=kns://plasmoids.knsrc/api.kde-look.org/1160672</p>

<p>It will call:</p>

<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);">/usr/lib/x86_64-linux-gnu/libexec/kf5/kpackagehandlers/knshandler kns://plasmoids.knsrc/api.kde-look.org/1160672</pre></div>

<p>Previously this file called <tt style="background: #ebebeb; font-size: 13px;">engine.install(entry);</tt><br />
the second argument (<tt style="background: #ebebeb; font-size: 13px;">linkId</tt>) isn't supplied so it defaults to 1.</p>

<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);">void install(KNSCore::EntryInternal entry, int linkId = 1);</pre></div>

<p>This means it downloads the first link, which for me is the oldest version of the widget typically.</p>

<p><a href="https://api.kde-look.org/ocs/v1/content/download/1160672/1" class="remarkup-link" target="_blank" rel="noreferrer">https://api.kde-look.org/ocs/v1/content/download/1160672/1</a><br />
tells it to download tiledmenu-v05-kde5.5.plasmoid</p>

<p>while<br />
<a href="https://api.kde-look.org/ocs/v1/content/download/1160672/3" class="remarkup-link" target="_blank" rel="noreferrer">https://api.kde-look.org/ocs/v1/content/download/1160672/3</a><br />
tells it to download the latest version tiledmenu-v18-kde5.9.plasmoid</p>

<p>This patch adds the ability to specify which link to download in the 3rd path section.</p>

<p>Eg: <tt style="background: #ebebeb; font-size: 13px;">kns://plasmoids.knsrc/api.kde-look.org/1160672/3</tt></p></div></div><br /><div><strong>TEST PLAN</strong><div><p>Shorten the command call for testing since knshandler isn't in <tt style="background: #ebebeb; font-size: 13px;">$PATH</tt>.</p>

<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);">alias knshandler='/usr/lib/x86_64-linux-gnu/libexec/kf5/kpackagehandlers/knshandler'</pre></div>



<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);">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</pre></div>

<p>knshandler kns://plasmoids.knsrc/api.kde-look.org/1160672/3<br />
<em> Should error, since we didn't uninstall the previous version. Should log:<br />
</em> Command ' "kpackagetool5 --install /tmp/tiledmenu-v18-kde5.9.plasmoid --type Plasma/Applet" ' failed with code 4</p>

<p>knshandler kns://plasmoids.knsrc/api.kde-look.org/1160672/test<br />
// linkId is not an integer QUrl("kns://plasmoids.knsrc/api.kde-look.org/1160672/test") ("api.kde-look.org", "1160672", "test")</p>

<p>knshandler kns://plasmoids.knsrc/api.kde-look.org/1160672/2/test<br />
// wrong format in the url path QUrl("kns://plasmoids.knsrc/api.kde-look.org/1160672/2/test") ("api.kde-look.org", "1160672", "2", "test")</p>

<p>knshandler kns://plasmoids.knsrc/api.kde-look.org/<br />
// wrong format in the url path QUrl("kns://plasmoids.knsrc/api.kde-look.org/") ("api.kde-look.org")</p>

<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);"></pre></div></div></div><br /><div><strong>REPOSITORY</strong><div><div>R252 Framework Integration</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D8636" rel="noreferrer">https://phabricator.kde.org/D8636</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>src/kpackage-install-handlers/kns/main.cpp</div></div></div><br /><div><strong>To: </strong>Zren<br /><strong>Cc: </strong>Frameworks<br /></div>