Bug 445530

Summary: Export screenshot to different app: "Internal error Could not prompt the user for which application to start"
Product: [Applications] Spectacle Reporter: postix <postix>
Component: GeneralAssignee: Boudhayan Gupta <me>
Status: RESOLVED FIXED    
Severity: normal CC: kde, nicolas.fella, postix
Priority: NOR    
Version First Reported In: 21.08.3   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
See Also: https://bugs.kde.org/show_bug.cgi?id=442301
Latest Commit: Version Fixed/Implemented In: 21.12.0
Sentry Crash Report:

Description postix 2021-11-15 12:59:22 UTC
STEPS TO REPRODUCE
1. Take a screenshot via Spectacle
2.  Click on "Export" -> "Different application"

OBSERVED RESULT
A notification appears saying "Internal Error: could not prompt the user for which application to start".
There are no further logs in `journalctl`

SOFTWARE/OS VERSIONS
Operating System: Fedora Linux 35
KDE Plasma Version: 5.22.5
KDE Frameworks Version: 5.87.0
Qt Version: 5.15.2
Kernel Version: 5.14.17-301.fc35.x86_64 (64-bit)
Graphics Platform: X11
Comment 1 Nicolas Fella 2021-11-15 13:36:31 UTC
Looks like using KNotificationJobUiDelegate (https://invent.kde.org/graphics/spectacle/-/blob/master/src/Gui/ExportMenu.cpp#L102) breaks the open with dialog
Comment 2 Bug Janitor Service 2021-11-15 14:01:44 UTC
A possibly relevant merge request was started @ https://invent.kde.org/graphics/spectacle/-/merge_requests/96
Comment 3 Nicolas Fella 2021-11-16 10:53:08 UTC
Git commit 2b7693328eb487c1d25504a28ffe3a27beebd92f by Nicolas Fella.
Committed on 16/11/2021 at 10:52.
Pushed by nicolasfella into branch 'master'.

Use KIO::JobUiDelegate for opening other application

KNotificationJobUiDelegate cannot open an 'Open With' dialog which is what we need here. Instead use the KIO delegate that can

M  +2    -1    src/Gui/ExportMenu.cpp

https://invent.kde.org/graphics/spectacle/commit/2b7693328eb487c1d25504a28ffe3a27beebd92f
Comment 4 Nicolas Fella 2021-11-16 17:48:47 UTC
Git commit 410fcc3b6fae86490ebcdd2fce040b9ff046a090 by Nicolas Fella.
Committed on 16/11/2021 at 17:48.
Pushed by nicolasfella into branch 'release/21.12'.

Use KIO::JobUiDelegate for opening other application

KNotificationJobUiDelegate cannot open an 'Open With' dialog which is what we need here. Instead use the KIO delegate that can
(cherry picked from commit 2b7693328eb487c1d25504a28ffe3a27beebd92f)

M  +2    -1    src/Gui/ExportMenu.cpp

https://invent.kde.org/graphics/spectacle/commit/410fcc3b6fae86490ebcdd2fce040b9ff046a090