Bug 352073 - "http://ksnapshot/" is opened in web browser if KSnapshot is not installed
Summary: "http://ksnapshot/" is opened in web browser if KSnapshot is not installed
Status: RESOLVED FIXED
Alias: None
Product: frameworks-kio
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: David Faure
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-08-31 21:00 UTC by Alexander Potashev
Modified: 2018-08-22 20:10 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Potashev 2015-08-31 21:00:17 UTC
see steps to reproduce below

Reproducible: Always

Steps to Reproduce:
1. Uninstall KSnapshot.
2. Press PrintScreen button on keyboard.

Actual Results:  
Chrome attempts to open "ksnapshot/".

Expected Results:  
I would expect an error message about KSnapshot not installed, or a dialog where I could choose another application to take screenshots.
Comment 1 Louis Moureaux 2015-12-21 16:19:34 UTC
I can confirm this using Plasma 5.5 and Applications 15.12.0. Arch Linux doesn't package ksnapshot anymore and uses spectacle instead.
Comment 2 Thomas Lübking 2015-12-24 21:50:38 UTC
Spectacle authors promised to provide a hotkey definition update?
Comment 3 Boudhayan Gupta 2015-12-25 10:12:32 UTC
If you uninstall KSnapshot, your ~/.config/khotkeysrc still includes references to ksnapshot, which makes it open as an URL in your browser. Removing it should fix things.

Spectacle does ship its own khotkeysrc file which is installed into ${CMAKE_DATA_DIR}/khotkeys. It ships as part of the Spectacle package, so without installing it you won't get the new definition files.

I can't close this bug, but I think an appropriate resolution would be INVALID.
Comment 4 Thomas Lübking 2015-12-25 16:08:37 UTC
We'd probably need some kind of kconf_update script to remove the ksnapshot bits when installing spectacle (though it's still possible to have both) - or in khotkeys (shipping default actions with khotkeys was probably a mistake ... 15 years ago ;-)

At least there's no ksnapshot (printscreen) default action anymore.

-> *Maybe* krun should not interpret "random_binary" as protocol/url.
Asking kio group.
Comment 5 David Faure 2016-02-20 20:02:55 UTC
new KRun(QUrl("random_binary")) doesn't open http://random_binary, it just outputs "KRun::scanFile: #### NO SUPPORT FOR READING!"

Do you have a more info about how exactly KRun is being called?

In general http:// being prepended means there's a QUrl::fromUserInput(str) call somewhere.
Comment 6 Thomas Lübking 2016-02-20 21:52:41 UTC
https://quickgit.kde.org/?p=khotkeys.git&a=blob&h=f107826df7ceccb81f37d13aee2760cf9803c1a4&hb=331336dfbdf7e6cc0bfc236913eea4a079681c65&f=libkhotkeysprivate%2Factions%2Fcommand_url_action.cpp

Looks like it should be

if( !KRun::runCommand(
                cmd + ( uri.hasArgsAndOptions() ? uri.argsAndOptions() : "" ),
                cmd, uri.iconName(), NULL ))

but could as well end up being

KUriFilterData::LocalFile =>  new KRun( uri.uri(), 0L);

I'd have to test myself (was just looking at some khotkeys bug while fixing some others ;-)
Comment 7 Nate Graham 2018-08-22 20:10:41 UTC
No longer an issue with Spectacle, and ssues with stale files would not be KIO's fault.