Bug 297720 - Unable to configure default file manager in System Settings.
Summary: Unable to configure default file manager in System Settings.
Status: RESOLVED FIXED
Alias: None
Product: systemsettings
Classification: Applications
Component: kcm_componentchooser (show other bugs)
Version: unspecified
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: Unassigned bugs mailing-list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-08 15:04 UTC by Ambroz Bizjak
Modified: 2012-06-28 09:36 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
kopenwithdialog.diff (7.60 KB, patch)
2012-06-18 12:05 UTC, David Faure
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ambroz Bizjak 2012-04-08 15:04:47 UTC
I want to use Nautilus (from Gnome 2) as the default file manager. I'm using KDE 4.8.2.

To reproduce:
1. Open System Settings, Default Applications.
2. There is no entry for Nautilus. So, choose "Other...".
3. Click on the button right to "Other...".
4. Click "Add". There is no entry for Nautilus (not even as "File Manager" or anything). So, type in "nautilus" and click "OK".
5. For some reason, the "nautilus" command is recognized now, and "File Manager" appears at the top of the list.
6. Click OK. The "Updating system configuration" dialog appears and closes shortly.

Back in the "Default Applications" control module, the choice is now no longer "Other"; it went back to "Open Folder with Thunar", in my case. If you click on the selection button again, the supposedly added "File Manager" is missing.
Comment 1 Thomas Lübking 2012-06-17 10:58:25 UTC
I'm willing to bet that the nautilus service has "OnlyShowIn=Gnome" or similar - check the nautilus.desktop file in /usr/share/applications (or a subdir, don't have nautilus installed)
Comment 2 Ambroz Bizjak 2012-06-17 12:04:53 UTC
Yes, nautilus.desktop has OnlyShowIn=GNOME;Unity;. I'm guessing something is filtering it where it shouldn't.
Comment 3 Thomas Lübking 2012-06-17 12:09:44 UTC
It means that the service is not available in KDE, remove the line or add KDE (eg. in a local copy in ~/.kde) - w/o the service the binary is not detected as filemanager and it's also not available in the application list (as such)

I'm neither maintainer nor developer in this context, but doubt that this is a "bug" but the expected behavior - the key isn't there for no reason.
Comment 4 Ambroz Bizjak 2012-06-17 12:42:35 UTC
This is *not* expected behaviour. The "custom" option provides a text box which seems to allow entering arbitrary commands to use as a file manager - the bug is that some commands don't work. What seems to happen is that the "nautilus" command is successfully linked to a hidden application, but then without warning filtered out.

I suppose a fix to this would be to either:
- Don't filter applications after they have been selected. This will allow you to use a hidden application by typing its name, and the name being linked to the hidden application.
- Don't recognize applications where OnlyShowIn is in effect. This will allow the user to add a new "nautilus" entry, independent of the existing entry. I would prefer the former option though, as some information about the application will be lost here.
Comment 5 Thomas Lübking 2012-06-17 14:05:52 UTC
(In reply to comment #4)
> This is *not* expected behaviour
OnlyShowIn services are not propagated in mismatching sessions, that is not only the expected but the specified behavior. [1]
If you want to use the nautilus service from KDE, copy it to ~/.local/share/applications and get rid of that line.

> The "custom" option provides a text box which seems to allow entering arbitrary 
> commands to use as a file manager - the bug is that some commands don't work

Here it opens the service selector for the inode/directory mimetype where i can attempt to add a service...

>> 2. There is no entry for Nautilus.
As expected.

>> 4. Click "Add". There is no entry for Nautilus (not even as "File Manager"
>> or anything).
As expected.

>>  So, type in "nautilus" and click "OK".
well, not expected but probably should be....

>> 5. For some reason, the "nautilus" command is recognized now
That is indeed NOT expected.

The "bug" is that it's actually possible to *force* a service into the mimetype selector, yes.
That's however somewhere in kdelibs (but i've no idea where precisely either, sorry)

[1] http://standards.freedesktop.org/desktop-entry-spec/latest/ar01s05.html
Comment 6 David Faure 2012-06-18 12:04:24 UTC
Forcing a service is fine. I think the bug is that we shouldn't reuse an existing .desktop file if it has "OnlyShowIn=Gnome" though, since that will confuse other bits of code.

Please test the attached patch.
Comment 7 David Faure 2012-06-18 12:05:28 UTC
Created attachment 71907 [details]
kopenwithdialog.diff
Comment 8 Ambroz Bizjak 2012-06-27 22:22:00 UTC
The patch works, applied to kdelibs 4.8.4. Thanks, and sorry for the delay.
Comment 9 David Faure 2012-06-28 08:52:58 UTC
Git commit 60e3adf447662da8e2bdc5993184909f19d8fd1e by David Faure.
Committed on 28/06/2012 at 10:53.
Pushed by dfaure into branch 'KDE/4.8'.

Don't use a .desktop file if it is not available in KDE

(e.g. due to "OnlyShowIn=Gnome").
Instead, create our own, when the user explicitely wants to use this app.

M  +1    -1    kio/kfile/kopenwithdialog.cpp

http://commits.kde.org/kdelibs/60e3adf447662da8e2bdc5993184909f19d8fd1e
Comment 10 Christoph Feck 2012-06-28 09:35:08 UTC
David, please commit to KDE/4.9 branch for kdelibs.
Comment 11 Christoph Feck 2012-06-28 09:36:32 UTC
Oh, you merged already :) Forget what I said.