D7343: auto generate desktop file for url handling

2017-08-21 Thread Harald Sitter
This revision was automatically updated to reflect the committed changes.
Closed by commit R134:dcae12f6b355: auto generate desktop file for url handling 
(authored by sitter).

REPOSITORY
  R134 Discover Software Store

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D7343?vs=18224=18488

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

AFFECTED FILES
  discover/CMakeLists.txt
  discover/org.kde.discover.desktop
  discover/org.kde.discover.desktop.cmake

To: sitter, apol, ltoscano, leinir
Cc: leinir, ltoscano, plasma-devel, ZrenBot, progwolff, lesliezhai, 
ali-mohamed, jensreuterberg, abetts, sebas, apol, mart, lukas


D7343: auto generate desktop file for url handling

2017-08-21 Thread Dan Leinir Turthra Jensen
leinir accepted this revision.
leinir added a comment.
This revision is now accepted and ready to land.


  Hmm... LGTM - mind that i am not the maintainer here, but it does look like 
it's likely the needed approach.

REPOSITORY
  R134 Discover Software Store

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

To: sitter, apol, ltoscano, leinir
Cc: leinir, ltoscano, plasma-devel, ZrenBot, progwolff, lesliezhai, 
ali-mohamed, jensreuterberg, abetts, sebas, apol, mart, lukas


D7343: auto generate desktop file for url handling

2017-08-20 Thread Luigi Toscano
ltoscano added a comment.


  In https://phabricator.kde.org/D7343#136271, @sitter wrote:
  
  > @ltoscano is this file name change compatible from an i18n POV?
  
  
  *.desktop.cmake files are processed like .desktop files also elsewhere, so 
this should work.

REPOSITORY
  R134 Discover Software Store

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

To: sitter, apol, ltoscano
Cc: ltoscano, plasma-devel, ZrenBot, progwolff, lesliezhai, ali-mohamed, 
jensreuterberg, abetts, sebas, apol, mart, lukas


D7343: auto generate desktop file for url handling

2017-08-16 Thread Harald Sitter
sitter reopened this revision.
sitter added a comment.


  Blergh, reverted. Pushed in wrong terminal.

REPOSITORY
  R134 Discover Software Store

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

To: sitter, apol, ltoscano
Cc: ltoscano, plasma-devel, ZrenBot, progwolff, lesliezhai, ali-mohamed, 
jensreuterberg, abetts, sebas, apol, mart, lukas


D7343: auto generate desktop file for url handling

2017-08-16 Thread Harald Sitter
This revision was automatically updated to reflect the committed changes.
Closed by commit R134:b433b503016e: auto generate desktop file for url handling 
(authored by sitter).

REPOSITORY
  R134 Discover Software Store

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D7343?vs=18221=18224

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

AFFECTED FILES
  discover/CMakeLists.txt
  discover/org.kde.discover.desktop
  discover/org.kde.discover.desktop.cmake

To: sitter, apol, ltoscano
Cc: ltoscano, plasma-devel, ZrenBot, progwolff, lesliezhai, ali-mohamed, 
jensreuterberg, abetts, sebas, apol, mart, lukas


D7343: auto generate desktop file for url handling

2017-08-16 Thread Harald Sitter
sitter added a reviewer: ltoscano.
sitter added a subscriber: ltoscano.
sitter added a comment.


  @ltoscano is this file name change compatible from an i18n POV?

REPOSITORY
  R134 Discover Software Store

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

To: sitter, apol, ltoscano
Cc: ltoscano, plasma-devel, ZrenBot, progwolff, lesliezhai, ali-mohamed, 
jensreuterberg, abetts, sebas, apol, mart, lukas


D7343: auto generate desktop file for url handling

2017-08-16 Thread Harald Sitter
sitter created this revision.
Restricted Application added a project: Plasma.
Restricted Application added a subscriber: plasma-devel.

REVISION SUMMARY
  configure_file on the desktop file to generate a NoDisplay variant to
  handle URLs (currently appstream: only) and have the standard desktop file
  only accept files.
  
  Discover can accept local files corresponding to a package format mimetype
  (e.g. rpm or deb) but these files must be strictly local as discover has
  no provisioning for downloading them on the file. To make this work
  we'll need an Exec line containing %F which makes kio download a remote
  URL to a local file before then passing it to discover. Namely clicking
  on a http://foo.bar/x.deb in a browser will cause kio to download the file
  and then start discover with the locally downloaded version.
  
  Conversely, discover also implements a scheme handler for appstream: which
  isn't itself a protocol implemented by KIO but instead acts as lookup
  URI. These URLS cannot be downloaded but instead must be passed verbatim
  to discover for handling, to have this working we need %U rather than %F.
  End result being that clicking appstream://org.kde.krita.desktop in a
  browser will immediately start discover displaying the krita page.
  
  To support both methods we need two separate desktop files, one to handle
  the package formats with %F and another handling appstream: with %U.
  We are now calling configure_file on a generic desktop file template to
  adjust it for these two use cases. The main org.kde.discover.desktop is
  visible in menus and can only handle local files. The new
  org.kde.discover.urlhandler.desktop is not visible in menus but used when
  KIO encounters an appstream url which it won't know what to do with.

TEST PLAN
  - try opening a http url pointing to a deb (probably needs to have mimetype 
deb in the http header fields)
  - should make plasma show a download arrow thingy
  
  - try opening appstream://org.kde.krita.desktop
  - should open discover right away and point it to the krita page
  
  - download old discord and install on neon 
https://dl.discordapp.net/apps/linux/0.0.1/discord-0.0.1.deb
  - open discord
  - should notify of new version and recommend to download the deb
  - click download
  - discord closes and plasma shows a download notification
  - discover starts with page for downloaded deb in ~/.cache/...

REPOSITORY
  R134 Discover Software Store

BRANCH
  Plasma/5.10

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

AFFECTED FILES
  discover/CMakeLists.txt
  discover/org.kde.discover.desktop
  discover/org.kde.discover.desktop.cmake

To: sitter, apol
Cc: plasma-devel, ZrenBot, progwolff, lesliezhai, ali-mohamed, jensreuterberg, 
abetts, sebas, apol, mart, lukas