KDE Developer
|
OK, so I tried this.
* ~/.local/share/applications/transmission-get.desktop * /usr/local/bin/transmission-get.sh with this line: kdialog --msgbox "$0 $1 called" (and chmod a+x) * A test HTML file with this line: <a href="magnet:?xt=urn:btih:foo">click me</a> -> at this point, ktorrent still opens, when clicking on the link. * Deleted $KDEDIR/share/kde4/services/magnet.protocol and /usr/share/kde4/services/magnet.protocol (I never used that anyway). Ran kbuildsycoca4. -> works, now when I click on the link I get my kdialog msgbox. (The bit about $KDEDIR above is because I use a self-compiled KDE, into my own prefix. But the files from /usr are visible too, due to XDG_DATA_DIRS containing both paths) More generally, use kde4-config --path services to see all directories where protocol files are searched for, and more specifically run this command to find magnet.protocol files: kde4-config --path services --locate magnet.protocol |
Registered Member
|
What's the purpose of your script exactly? Do u have a centralized maching downing the downloading of all ur torrents.
I'm asking because if that's what you want, check out this chrome extension https://chrome.google.com/webstore/deta ... fdghcmenci it worked out for me pretty well with almost 0 initial setup time |
Registered Member
|
I just tested this method (using kdialog) and I still get the same error. Can you please post the transmission-get.desktop file you created? Here's what mine looks like:
I tested with that command. No magnet.protocol files found on the system.
Yes, I have Transmission running in daemon mode on my firewall/router. Nothing against Chrome, but I'd rather stick with Konqueror |
Registered Member
|
Konqueror really? Not even rekonq?! You're really old-school |
KDE Developer
|
Exactly the same here. (Just without the double-quotes around %u, shouldn't matter though) There must be some leftover on your system. I assume you tried `kbuildsycoca4 --no-incremental` already? Otherwise, try as another user, or on another machine? |
Registered Member
|
I have just run `kbuildsycoca4 --noincremental` then rebooted and ran it again just to be sure, but I still get the same error. If there is some leftover magnet.protocol file, I (using the find command) can't find it anywhere. There are also no files in either of the paths given by `kde4-config --path services` that even have the word 'magnet' in them. So I followed your advice and set up a new user on this machine. I copied the transmission-get.desktop file to the new user's .local/share/applications/ directory, ran `kbuildsycoca4 --noincremental`, clicked on a maget link and it worked! What else could be leftover in my home directory that is causing it to fail in my account? |
Administrator
|
Please post the output of the following:
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Registered Member
|
So I changed ~/.kde4 to ~/.kde
It finds no files at all. |
Administrator
|
While outside KDE, please move ~/.local/share/mime elsewhere, and also erase /var/tmp/kdecache-$USER/.
If you have made any custom file associations, they will likely be lost in the process, but this will ensure that any old associations with the protocols are hopefully removed.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Registered Member
|
Edit: Removed duplicate post.
Last edited by DrTwox on Fri Oct 19, 2012 11:26 pm, edited 1 time in total.
|
Registered Member
|
Thank you to each person who offered help with this. Before the last suggestion was posted I gave up and just did a fresh install of the new Kubuntu release and I have got it working, except with one minor annoyance! When clicking a magnet link, instead of just opening the link with my script, Konqueror prompts me with a dialog:
This untrusted page links to magnet:?xt=urn:btih:XXXXXXXXXXX Do you want to follow the link? [Follow] [Cancel] This dialog doesn't pop up when using ktorrent, so it must be possible to disable it? How? Again, thank you to all who offered help and support! Very appreciated. |
KDE Developer
|
Ouch. Tricky issue. KAuthorized::authorizeUrlAction looks at the "protocol class", and accepts :internet -> :internet, and warns for :internet -> :local. With this way of using the magnet protocol, we have no .protocol file anymore, so no associated class, so KAuthorized sees a redirection from :internet to ":" (empty), and warns.
The introduction of x-scheme-handler/protocol support comes from a freedesktop.org "standard", but the "protocol class" thing is KDE-specific, so obviously it wasn't taken into account in that standard. OK, I know what the solution is: giving preference to x-scheme-handler apps over old-style exec=... in the protocol file, and this way we can keep the magnet.protocol file around, to provide such information. Fixed in http://commits.kde.org/kdelibs/74047642 ... 6d43cd3a7f (will be in 4.9.3) Class=:internet has to be added to magnet.protocol, though... Done: http://commits.kde.org/ktorrent/51bdf13 ... 4693d2aeae Sounds like magnet.protocol should be moved to more centralized location, though... |
Registered Member
|
Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]