<table><tr><td style="">broulik created this revision.<br />broulik added reviewers: Plasma, hein.<br />Herald added a project: Plasma.<br />Herald added a subscriber: plasma-devel.<br />broulik requested review of this revision.
</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/D26941">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>The code tried hard to ignore garbage URLs, as Qt is quite lenient, e.g. <tt style="background: #ebebeb; font-size: 13px;">QUrl("Garbage Url")</tt> is still valid.<br />
There is no way to change the strictness of a <tt style="background: #ebebeb; font-size: 13px;">QUrl</tt> after creation, so the code would enforce it by doing <tt style="background: #ebebeb; font-size: 13px;">QUrl strictUrl(inputUrl.toString(), QUrl::StrictMode)</tt>.<br />
However, <tt style="background: #ebebeb; font-size: 13px;">toString()</tt> defaults to <tt style="background: #ebebeb; font-size: 13px;">PrettyDecoded</tt> which avoids percent-encoding and keeps spaces in tact which is not a valid thing to have in a strict URL.<br />
Effectively, we want to ensure a URL is either a valid path to a local file, or one of the special <tt style="background: #ebebeb; font-size: 13px;">applications</tt> (for menu ids), or <tt style="background: #ebebeb; font-size: 13px;">preferred</tt> for preferred applications, like web browser,</p>
<p>BUG: 385727<br />
FIXED-IN: 5.18.0</p></div></div><br /><div><strong>TEST PLAN</strong><div><p>Is this still good for 5.18?</p>
<ul class="remarkup-list">
<li class="remarkup-list-item">Unit tests still pass</li>
<li class="remarkup-list-item">Comes with a new one to verify adding desktop entries with spaces works</li>
<li class="remarkup-list-item">Pinned an application which had spaces in its desktop file to the task bar:<ul class="remarkup-list">
<li class="remarkup-list-item">Was successfully added with the menu</li>
<li class="remarkup-list-item">Was successfully merged with the window, if open</li>
<li class="remarkup-list-item">Was successfully restored/loaded on plasmashell restart</li>
<li class="remarkup-list-item">Was successfully removed with the context menu</li>
</ul></li>
<li class="remarkup-list-item">Created a new activity, pinned an application which had spaces in its desktop file to only one activity:<ul class="remarkup-list">
<li class="remarkup-list-item">Was successfully restored/hidden when switching activities</li>
<li class="remarkup-list-item">all of the above</li>
</ul></li>
</ul></div></div><br /><div><strong>REPOSITORY</strong><div><div>R120 Plasma Workspace</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D26941">https://phabricator.kde.org/D26941</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>libtaskmanager/autotests/launchertasksmodeltest.cpp<br />
libtaskmanager/launchertasksmodel.cpp<br />
libtaskmanager/launchertasksmodel_p.h</div></div></div><br /><div><strong>To: </strong>broulik, Plasma, hein<br /><strong>Cc: </strong>plasma-devel, Orage, LeGast00n, The-Feren-OS-Dev, jraleigh, zachus, fbampaloukas, GB_2, ragreen, ZrenBot, ngraham, alexeymin, himcesjf, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, ahiemstra, mart<br /></div>