Bug 404182

Summary: Allow download notification to be drag and dropped
Product: [Plasma] plasma-browser-integration Reporter: magnus.gross21
Component: generalAssignee: Kai Uwe Broulik <kde>
Status: RESOLVED FIXED    
Severity: wishlist CC: nate
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In: 5.18.0
Sentry Crash Report:

Description magnus.gross21 2019-02-10 17:44:44 UTC
It would be great, if we could drag and drop from the download notification.

For example, in the Screenshot app Spectacle, when it saves the screenshot, it also posts a notification which you can directly drag and drop to embed the screenshot somewhere.

It would be cool, if we could have the same thing for the Browser integration, i.e. I download a file and I can drag the file directly from the notification.
Comment 1 Nate Graham 2019-02-11 20:03:48 UTC
Awesome idea.
Comment 2 magnus.gross21 2019-02-24 19:18:40 UTC
I would love to write the code for this myself as my first contribution to KDE, but I could need some advice on how to do it in the best way.

I have implemented pretty much the same feature for flameshot, which was pretty straight forward, as you just have to set the x-kde-urls field: https://github.com/lupoDharkael/flameshot/pull/473

But I am not really sure about the best way here, as it seems like the KJob subclass automatically generates the notification on finishing and I do not see a straight forward way to inject the x-kde-urls field somewhere.
Comment 3 Kai Uwe Broulik 2019-03-07 08:15:59 UTC
The finished notification comes from the job tracker and is automatically issued when a job is finished.

It needs to be implemented there, which isn't easy: I noticed that often times when copying files, the URL isn't updated when you chose to rename instead of overwriting a file, and that it is shown before the last file is processed.
Comment 4 Kai Uwe Broulik 2019-03-13 11:31:16 UTC
Git commit b09312ad384b41c3eaaca0d11a75c8b07cd4fc2e by Kai Uwe Broulik.
Committed on 13/03/2019 at 11:30.
Pushed by broulik into branch 'master'.

[DownloadJob] Set destUrl and total amount

Will eventually allow us to show a nice finished notification.
Related: bug 402144

Differential Revision: https://phabricator.kde.org/D19589

M  +7    -1    host/downloadjob.cpp

https://commits.kde.org/plasma-browser-integration/b09312ad384b41c3eaaca0d11a75c8b07cd4fc2e
Comment 5 Kai Uwe Broulik 2020-04-06 17:45:36 UTC
This works as of Plasma 5.18