notifications: Correctly display the file in jobs
ClosedPublic

Authored by xuetianweng on Mar 1 2017, 11:41 PM.

Details

Summary

For url with parameter like audiocd:/1.wav?device=/dev/sr0, the filename
displayed in notifications applet is not correct ("sr0") instead of 1.wav.
This commit try to remove the query string before extract the last path
component.

Test Plan

Manually with audiocd-kio

Diff Detail

Repository
R120 Plasma Workspace
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
xuetianweng created this revision.Mar 1 2017, 11:41 PM
Restricted Application added a project: Plasma. · View Herald TranscriptMar 1 2017, 11:41 PM

Label0 comes from the dataengine
We have some nice C++ methods to get a filename from a URL, can we do it there?

(If not, ship this. it seems fine)

Label0 comes from the dataengine
We have some nice C++ methods to get a filename from a URL, can we do it there?

(If not, ship this. it seems fine)

Label0 is also used elsewhere. We could add another value to engine though, not sure if worth it.

mart edited edge metadata.Mar 2 2017, 11:02 AM

(If not, ship this. it seems fine)

Label0 is also used elsewhere. We could add another value to engine though, not sure if worth it.

it's used in the job delegate and as an error message when the transfer fails. maybe having the simple file name is ok in both cases?

In D4879#91745, @mart wrote:

(If not, ship this. it seems fine)

Label0 is also used elsewhere. We could add another value to engine though, not sure if worth it.

it's used in the job delegate and as an error message when the transfer fails. maybe having the simple file name is ok in both cases?

I realized this is a generic description field.. not sure if always interpret it as a url is correct..

Are we talking about do the file name parsing in dataengine, and has a separate data field, called labelFileNameN, and keep it update with labelN?

Sorry, for the delayed response.

Are we talking about do the file name parsing in dataengine, and has a separate data field, called labelFileNameN, and keep it update with labelN?

Yes, that way any other notification implementation gets this fix too.

If that isn't do-able, feel free to merge this as-is.

update based on david's comments.

davidedmundson accepted this revision.Aug 19 2017, 9:04 PM
This revision is now accepted and ready to land.Aug 19 2017, 9:04 PM
This revision was automatically updated to reflect the committed changes.