D10383: Fix pinning apps when their .desktop file has a space in the file name.

Kai Uwe Broulik noreply at phabricator.kde.org
Thu Feb 8 10:02:02 UTC 2018


broulik added a comment.


  > Is rejecting scheme-less URLs going to break anything?
  
  I think we're doing a quite good job of ensuring we have a `file:` or other scheme, so this //should'nt// cause behavior changes.
  
  > Can we be confident QUrl::operator== will abstract over this?
  
  Being confident about `QUrl` stuff is tricky :) but naive testing showed that `QUrl` considers a URL with spaces and percent-encoded spaces equal.

INLINE COMMENTS

> startuptasksmodel.cpp:208
>          if (!menuId.isEmpty()) {
> -            return QUrl(QStringLiteral("applications:") + menuId);
> +            return QUrl(QStringLiteral("applications:") + QUrl::toPercentEncoding(menuId));
>          }

`QUrl::toPercentEncoding` encodes *all* UTF-8 characters and slashes and what not whereas in `toString` you only tell it to `EncodeSpaces`

> tasktools.cpp:731
>  
> -            KActivities::ResourceInstance::notifyAccessed(QUrl(QStringLiteral("applications:") + service->storageId()),
> +            KActivities::ResourceInstance::notifyAccessed(QUrl(QStringLiteral("applications:") + QUrl::toPercentEncoding(service->storageId())),
>                  QStringLiteral("org.kde.libtaskmanager"));

Is KActivities smart enough to relate the two with and without spaces?

REPOSITORY
  R120 Plasma Workspace

REVISION DETAIL
  https://phabricator.kde.org/D10383

To: hein, #plasma, broulik
Cc: plasma-devel, ZrenBot, progwolff, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20180208/85fabb2a/attachment.html>


More information about the Plasma-devel mailing list