[Bug 979265] New: Krusader as mimeapp not properly registered outside KDE
http://bugzilla.opensuse.org/show_bug.cgi?id=979265 Bug ID: 979265 Summary: Krusader as mimeapp not properly registered outside KDE Classification: openSUSE Product: openSUSE Distribution Version: Leap 42.1 Hardware: Other OS: Other Status: NEW Severity: Normal Priority: P5 - None Component: KDE Applications Assignee: opensuse-kde-bugs@opensuse.org Reporter: enno.nagel@t-online.de QA Contact: qa-bugs@suse.de Found By: --- Blocker: --- The desktop entry of krusader should be listed in a file kde-mimeapps.list and NOT in the current file mimeapps.list because of the KDE-specific parameter '-c ...' in the krusader.desktop file. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=979265
http://bugzilla.opensuse.org/show_bug.cgi?id=979265#c1
Wolfgang Bauer
The desktop entry of krusader should be listed in a file
kde-mimeapps.list
and NOT in the current file
mimeapps.list
Can you please elaborate?
because of the KDE-specific parameter '-c ...' in the krusader.desktop file.
I suppose you mean '-caption "%c"', there is no '-c ...' in the krusader.desktop file... But where's the problem with that? The '-caption' parameter is evaluated by krusader itself (or actually kdelibs4), and is independent of the desktop. And if you mean the '%c' (or '%i' for that matter), that's specified in the freedesktop.org desktop entry specification, it's not KDE-specific at all: https://specifications.freedesktop.org/desktop-entry-spec/latest/ar01s06.htm... -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=979265
http://bugzilla.opensuse.org/show_bug.cgi?id=979265#c2
--- Comment #2 from Enno Nagel
http://bugzilla.opensuse.org/show_bug.cgi?id=979265
http://bugzilla.opensuse.org/show_bug.cgi?id=979265#c3
--- Comment #3 from Wolfgang Bauer
For example if
inode/directory=krusader.desktop
Where?
then
xdg-open .
under awesome WM with the standard krusader.desktop file does not open Krusader.
Well, that's more a problem of xdg-open then, I suppose. Do you get any error message?
Now
krusader --help
and
krusader --help-kde
shows that
krusader --caption %c
is specific to KDE.
Yes, it is specific to KDE applications, just as e.g. "--writer" is specific to LibreOffice. Are applications not allowed any more to have their specific command line options?
Therefore, this option should only used under KDE,
This conclusion is wrong. You can run "krusader -caption xxx" in any desktop session, just as you can run "loffice --writer" in any desktop session. Again, it's the application that evaluates this parameter, not the desktop session (or xdg-open).
ensured by renaming the current krusader.desktop file to kde-krusader.desktop
Now that's even more pointless IMHO, and won't do what you probably think it would. Btw, the correct line in mimeapps.list should probably be: inode/directory=kde4-krusader.desktop , because krusader.desktop is installed to /usr/share/applications/kde4/. But krusader.desktop should find kde4/krusader.desktop as well. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=979265
http://bugzilla.opensuse.org/show_bug.cgi?id=979265#c4
--- Comment #4 from Enno Nagel
http://bugzilla.opensuse.org/show_bug.cgi?id=979265
http://bugzilla.opensuse.org/show_bug.cgi?id=979265#c5
--- Comment #5 from Wolfgang Bauer
You ask where but then add
Btw, the correct line in mimeapps.list should probably be: inode/directory=kde4-krusader.desktop
You were talking of some mimeapps.list somewhere, and I asked where. What's your problem with that? So, what mimeapps.list are you talking about? ~/.local/share/applications/mimeapps.list?
Your atitude renders this discussion pointless.
I just don't understand what you want from us, and why. As I explained, the -caption "%c" in the desktop file is perfectly valid regardless of the desktop session, so why should we remove it? Try running "krusader -caption huhu" in a terminal in your session if you don't believe me. And renaming the desktop file doesn't make sense to me either. If xdg-open isn't able to start krusader, this is what should be investigated. But you didn't even answer my question whether you get an error message. So much about attitude...
If it worked under Awesome WM as is, but in fact only does so with the proposed work around, this bug report would not be here.
That doesn't mean it's a bug in krusader's desktop file though.
Please close as pointless.
You can close it yourself. Or provide further explanations/answers so we can find out what the actual problem is. As you prefer. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=979265
http://bugzilla.opensuse.org/show_bug.cgi?id=979265#c6
--- Comment #6 from Enno Nagel
http://bugzilla.opensuse.org/show_bug.cgi?id=979265
http://bugzilla.opensuse.org/show_bug.cgi?id=979265#c7
--- Comment #7 from Wolfgang Bauer
Under Awesome WM,
--- ~ » krusader -c 'hallo' krusader: Option « c » inconnue. krusader: Utilisez « --help » pour obtenir la liste des options de ligne de commande disponibles.
That is to be expected. '-c' is *not* a supported option, not even inside a KDE session. Again, try "krusader -caption 'hallo'" (without the double quotes), that should work fine, also in awesome or any other session. The desktop file contains krusader -caption, not krusader -c, those two are *not* the same. (--caption would work as well though)
then
xdg-open .
does not open Krusader.
Yes, you already wrote that. But what happens instead? Again, do you get any error message? If yes what message exactly?
Everything is fine, because the Krusader package apparently only installs a /usr/share/applications/kde4/krusader.desktop.
Yes.
But now there's a module by which an applications can be attached to a file type, say a folder (inode), and if Krusader is chosen, then this association works under KDE but not, for example, under Awesome WM. Therefore, this module should update a kde4-mimeapps.list, but not, say ~/.local/share/applications/mimeapps.list.
It's this "module"'s choice whether it updates a kde4-mimeapps.list (should actually be kde-mimeapps.list btw) or a mimeapps.list. I don't see how we should influence that from the KDE/krusader side (the desktop file name's prefix, e.g. kde-, does *not* indicate that it should only be used by a specific desktop session). And if you do set krusader as default application in awesome, it should of course be used as default application in awesome, no? I suppose it would be unexpected if *some* applications you set in that "module" are only respected by a KDE desktop, while others would be used by all desktops. What "module" is that exactly btw? But again, the very same krusader.desktop file (with -caption as command line parameter) *should* work outside a KDE desktop session too, it contains nothing that's specific to a KDE desktop session. If it doesn't work for you, something is going wrong somewhere, and we need to find out what that is exactly. My best guess so far would be that the expansion of %c (by xdg-open in this case) results in an invalid command line. A wild guess: maybe removing the double quotes around the %c would fix it too? If I understand the specs correctly, they shouldn't be necessary. Unfortunately I cannot really reproduce this here. xdg-open seems to just ignore my ~/.local/share/applications/mimeapps.list (regardless whether I set krusader or something else) when I run it outside of KDE, and always starts nautilus... (this would also qualify as "does not open Krusader", but removing the -caption option from krusader.desktop does not fix that... ;-) ) Haven't tried awesome though as I don't have it installed, maybe I will install it tomorrow. xdg-open does try to find out in what desktop session it runs and uses different methods to find the default application accordingly. Could you please provide your actual mimeapps.list file too (for the sake of trying to reproduce it), to rule out a mistake on my part? -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=979265
http://bugzilla.opensuse.org/show_bug.cgi?id=979265#c8
--- Comment #8 from Enno Nagel
http://bugzilla.opensuse.org/show_bug.cgi?id=979265
http://bugzilla.opensuse.org/show_bug.cgi?id=979265#c9
--- Comment #9 from Enno Nagel
http://bugzilla.opensuse.org/show_bug.cgi?id=979265
http://bugzilla.opensuse.org/show_bug.cgi?id=979265#c10
--- Comment #10 from Wolfgang Bauer
Ok, true
krusader -caption "%c"
opens Krusader.
Ok, I hope you are convinced now that the "-caption" option is *not* specific to a KDE desktop session and therefore the option per se is not the problem.
But with either
Exec=krusader -caption "%c"
or
Exec=krusader %i
in /usr/share/applications/kde4/krusader.desktop
then again, Krusader fails to start under Awesome WM.
And a third time: do you get an error message? If Exec=krusader %i fails as well, then probably the %i is the reason (although as mentioned in comment#1, this is specified in the freedesktop.org specs and is not at all specific to KDE either). Does it work if the file just says: Exec=krusader -caption %c ? -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=979265
http://bugzilla.opensuse.org/show_bug.cgi?id=979265#c11
--- Comment #11 from Enno Nagel
http://bugzilla.opensuse.org/show_bug.cgi?id=979265
http://bugzilla.opensuse.org/show_bug.cgi?id=979265#c12
Wolfgang Bauer
http://bugzilla.opensuse.org/show_bug.cgi?id=979265
Wolfgang Bauer
http://bugzilla.opensuse.org/show_bug.cgi?id=979265
http://bugzilla.opensuse.org/show_bug.cgi?id=979265#c13
--- Comment #13 from Wolfgang Bauer
http://bugzilla.opensuse.org/show_bug.cgi?id=979265
http://bugzilla.opensuse.org/show_bug.cgi?id=979265#c14
Wolfgang Bauer
'caption Krusader --icon krusader_user' is indeed not a valid command line option, but I'm not sure yet why the whole is treated as one option...
The problem seems to be in the search_desktop_file() function in xdg-open: if echo "$arguments" | grep -iq '%[fFuU]' ; then echo START "$command_exec" "$arguments_exec" eval "'$command_exec'" "'$arguments_exec'" else echo START "$command_exec" "$arguments_exec" "$arg" eval "'$command_exec'" "'$arguments_exec'" "'$arg'" fi That double quoting in the "eval" lines looks a bit strange to me, and indeed changing it to eval "$command_exec" (and so on) fixes the problem. OTOH, this has been added as security fix, see bnc#913676. CC'ing the xdg-utils bugowner for further insight. Btw, the function has been completely rewritten in upstream git meanwhile, I haven't tried yet whether this problem still persists though. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=979265
http://bugzilla.opensuse.org/show_bug.cgi?id=979265#c15
Wolfgang Bauer
http://bugzilla.opensuse.org/show_bug.cgi?id=979265
http://bugzilla.opensuse.org/show_bug.cgi?id=979265#c16
--- Comment #16 from Wolfgang Bauer
http://bugzilla.opensuse.org/show_bug.cgi?id=979265
Wolfgang Bauer
http://bugzilla.opensuse.org/show_bug.cgi?id=979265
http://bugzilla.opensuse.org/show_bug.cgi?id=979265#c17
--- Comment #17 from Wolfgang Bauer
http://bugzilla.opensuse.org/show_bug.cgi?id=979265
Wolfgang Bauer
http://bugzilla.opensuse.org/show_bug.cgi?id=979265
http://bugzilla.opensuse.org/show_bug.cgi?id=979265#c18
Wolfgang Bauer
http://bugzilla.opensuse.org/show_bug.cgi?id=979265
http://bugzilla.opensuse.org/show_bug.cgi?id=979265#c19
--- Comment #19 from Simon Lees
PS: This upstream commit (the first one after the version that is in Leap 42.1) fixes the problem for me as well: https://cgit.freedesktop.org/xdg/xdg-utils/commit/ ?id=13d9b0cac97e438bf7dc06452ee7fb3480907d88
So maybe we should release an update with this for Leap and 13.2.
Thanks for tracking this down, i'll test then do that. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=979265
http://bugzilla.opensuse.org/show_bug.cgi?id=979265#c20
--- Comment #20 from Wolfgang Bauer
Thanks for tracking this down, i'll test then do that.
Great, thanks! Btw: to be sure, I tested the Factory package too, and it does work there as expected. But even with the latest version, I still have the problem when the line contains a ';' at the end, see comment#12. Would be awesome if we could fix that too... A (seemingly related) upstream bug report is here: https://bugs.freedesktop.org/show_bug.cgi?id=44163 which even contains some sort of patch. Though it doesn't apply any more, and I think the proper solution would be not to patch xdg-open, but to make "xdg-mime query default inode/directory" not return the ';' in the first place. It doesn't when run inside KDE e.g. Anyway, I'll probably file a separate bug report about this, I just wanted to mention it here so that you can maybe still wait a bit with the update... ;-) -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=979265
http://bugzilla.opensuse.org/show_bug.cgi?id=979265#c21
--- Comment #21 from Simon Lees
http://bugzilla.opensuse.org/show_bug.cgi?id=979265
http://bugzilla.opensuse.org/show_bug.cgi?id=979265#c22
--- Comment #22 from Simon Lees
http://bugzilla.opensuse.org/show_bug.cgi?id=979265
http://bugzilla.opensuse.org/show_bug.cgi?id=979265#c23
--- Comment #23 from Wolfgang Bauer
Jiri added a fix for something related to the second issue at some point, https://build.opensuse.org/package/view_file/openSUSE:Leap:42.1/xdg-utils/ xdg-mime-generic-do-not-return-more-than-one-default.patch?expand=1
That patch doesn't help in this case, the patch is actually included in the 13.2 and Factory packages which I both tried. It apparently fixes a problem when the mimetype (and a default application) is listed in both defaults.list and mimecache.cache on a quick glance. That line does cut when it encounters an ';' though (even before that patch you mentioned), just like it should be done for mimeapps.list too I'd say. I.e. changing: trader_result=`awk -v mimetype="$MIME" ' BEGIN { ... } ' $mimeapps_list` to: trader_result=`awk -v mimetype="$MIME" ' BEGIN { ... } ' $mimeapps_list | cut -d ';' -f 1` a few lines above should fix this problem. Haven't tried that yet though, I will do so tomorrow. (it's too late now... ;) ) -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=979265
http://bugzilla.opensuse.org/show_bug.cgi?id=979265#c24
--- Comment #24 from Simon Lees
http://bugzilla.opensuse.org/show_bug.cgi?id=979265
http://bugzilla.opensuse.org/show_bug.cgi?id=979265#c25
--- Comment #25 from Wolfgang Bauer
' $mimeapps_list | cut -d ';' -f 1` a few lines above should fix this problem.
Haven't tried that yet though, I will do so tomorrow. (it's too late now... ;) )
I did do a few quick tests already (on 13.2), and it indeed seems to work as intended, including fixing xdg-open. I.e. both: "inode/directory=kde4-ark.desktop;" and "inode/directory=kde4-ark.desktop;kde4-dolphin.desktop;" in ~/.local/share/mimeapps.lists make "xdg-open ." start ark now with this change (I don't have Krusader installed here so used something different, it of course gives an error message that it cannot open /home/xxx/, but that's irrelevant here... ;-) ), while they called Firefox before. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=979265
http://bugzilla.opensuse.org/show_bug.cgi?id=979265#c26
Simon Lees
http://bugzilla.opensuse.org/show_bug.cgi?id=979265
http://bugzilla.opensuse.org/show_bug.cgi?id=979265#c29
Rex Dieter
http://bugzilla.opensuse.org/show_bug.cgi?id=979265
http://bugzilla.opensuse.org/show_bug.cgi?id=979265#c30
--- Comment #30 from Simon Lees
I tried it, but there's a regression: It doesn't accept kde4-krusader.desktop any more, though that did work before (xdg-open did start krusader if mimeapps.list contained kde4-krusader.desktop, without the semicolon at least).
krusader.desktop does work, but KDE's systemsettings writes kde4-krusader.desktop because krusader.desktop is installed to /usr/share/applications/kde4/ (that's correct behaviour AFAIK, and does still work in a KDE session).
Thanks, i'll look into that, appears to be another thing not supported by desktop_file_to_binary, when I tried on Leap I thought it wrote krusader.desktop still, but I will re test that.
Other than that it does seem to work, it uses the first application in the list if that exists, if not it tries the second one, and so on.
Another remark: The second change in xdg-mime-generic-do-not-return-more-than-one-default-2.patch doesn't make sense to me, it doesn't have any effect IMHO. The assignment to trader_result already does cut off everything after (and including) the first semicolon (cut -d ';' -f 1). As there can be multiple .desktop files in this case too, that "| cut -d ';' -f 1" (at the end of line 386 in the original file) should be removed I'd say.
Thanks good pickup -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=979265
http://bugzilla.opensuse.org/show_bug.cgi?id=979265#c31
--- Comment #31 from Simon Lees
This simpler fix that I committed upstream works for me: https://cgit.freedesktop.org/xdg/xdg-utils/commit/ ?id=a5ec775d7631bf32760acc1c1b54a4905cfdec89
Yeah, I was trying to be a bit smarter and return the first in the list that actually exists, rather then just the first although I guess in most cases the first should always exist. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=979265
http://bugzilla.opensuse.org/show_bug.cgi?id=979265#c32
--- Comment #32 from Rex Dieter
http://bugzilla.opensuse.org/show_bug.cgi?id=979265
http://bugzilla.opensuse.org/show_bug.cgi?id=979265#c36
Simon Lees
participants (1)
-
bugzilla_noreply@novell.com