Bug 456026

Summary: zip archive files not associated properly in Firefox
Product: [openSUSE] openSUSE 11.3 Reporter: Rod Schaffter <rodschaffter>
Component: GNOMEAssignee: E-mail List <gnome-bugs>
Status: RESOLVED UPSTREAM QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P4 - Low CC: binner, ctrippe, gcutter, hi-du, lnussel, mgonzlezgmz, sbrabec, vuntz, wolfgang
Version: Final   
Target Milestone: Factory   
Hardware: All   
OS: Other   
Whiteboard: desktop-interop
Found By: Beta-Customer Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: Console output from export NSPR_LOG_MODULES=HelperAppService:5
gnome_defaults-to-defaults_conf

Description Rod Schaffter 2008-12-03 14:36:32 UTC
zip archives are not associated with Ark, but instead are associated with 'Wine Windows Program Loader'.  Manually adding Ark to the association in Firefox' Preferences does not give it as an option when downloading a zip file and attempting to open one from the Downloads window.  

It is impossible to remove the association to Wine Windows Program Loader in Firefox' Preferences-clicking on the Application Details button in preferences shows only Firefox, and Ark once it has been manually added.

As an aside, in 11.1 RC1, Zip archives are not associated with Ark in KDE 3.5, either, but are viewed within Konqueror.  There was an association in 10.3, as there was an option in the right-click menu to open in Ark.  I don't have an 11.0 box handy to check it there.
Comment 1 Wolfgang Rosenauer 2008-12-03 18:54:12 UTC
Please provide more information about the ZIP you wanted to open.
I need to know the exact file extension _and_ which content-type the webserver was sending along for the file.
So if it was from a public webserver please let us know the URL and if not you might get some useful information when running firefox after exporting

export NSPR_LOG_MODULES=HelperAppService:5
and reproducing the issue and attach the console output.
Comment 2 Rod Schaffter 2008-12-03 20:52:54 UTC
Hi Wolf, 

Starting with  a fresh .Mozilla directory, there is initially no association for .zip files under Edit>Preferences>Applications.  Clicking on a zip file link creates the association with Wine (curious, since wine isn't associated with windows binaries in KDE).  

Here are a couple of URLS:

This is a 3d model;

http://www.sharecg.com/v/30702/Poser/Celebration-08,-day-3--Elfette-dress-for-mfd

This is a funny old graphic zipped:

http://hobbes.nmsu.edu/download/pub/windows/deadwin.zip

Attached is the requested log.  I loaded up Firefox, downloaded a Zip file, and attempted to open it from the Downloads Window. 
Comment 3 Rod Schaffter 2008-12-03 20:55:17 UTC
Created attachment 257856 [details]
Console output  from export NSPR_LOG_MODULES=HelperAppService:5 

I loaded up Firefox, downloaded a Zip file, and
attempted to open it from the Downloads Window.
Comment 4 Rod Schaffter 2008-12-03 21:47:22 UTC
On a related note, I just discovered PDF files are associated with the GIMP.  
Comment 5 Wolfgang Rosenauer 2008-12-03 22:46:09 UTC
Ok, let me explain a bit how this works in Firefox.
There is a list of helper applications in the preferences but these are just additional selections used to override the "automatic" mechanism to find the helper application to open some file.
Every desktop application provides a desktop file where it defines mime-types for all types the application is able to handle.
That includes PDF in Gimp and zip in Wine. Some SuSEconfig and mime-info magic chooses one default application which seems to fit best for certain types.
Since Firefox uses gnome-vfs to determine that stuff it actually prefers Gnome and Gtk applications as long as they are installed. If they are not installed gnome-vfs falls back (I guess) to the first hit for a certain mime-type which is probably not the best option.

Please check on your system the file /usr/share/applications/defaults.list and look up which desktop file it mentions for "application/zip" and "application/pdf"
Comment 6 Rod Schaffter 2008-12-03 23:40:43 UTC
Ah Ha!!

application/x-zip-compressed=wine.desktop

application/pdf=gimp.desktop

So this bug apparently belongs to whomever owns the generation of defaults.list- that would probably be the SUSEconfig folks?.
Comment 7 Rod Schaffter 2008-12-04 02:56:16 UTC
I deleted the above two lines from defaults.list and restarted Firefox and all works as it should.  

Should I file a new bug roport, or can this one be transfered to the appropriate group?
Comment 8 Wolfgang Rosenauer 2008-12-04 07:05:52 UTC
I'm not sure it is actually a bug but let's ask someone else.
You can modify that behaviour in /etc/gnome_defaults.conf FWIW.
Comment 9 Stanislav Brabec 2008-12-04 09:10:48 UTC
The problem is apparent. The fix is not trivial.

As gnome-vfs is a GNOME application, it (AFAIK correctly) should prefer GNOME applications. In this case, no GNOME applications are present.

Even if GNOME ZIP archiver (file-roller) will be present, KDE user will not be satisfied with the result (using file-roller instead of Ark).

default.list cannot be changed on fly, as GNOME and KDE users can work in parallel on the same machine.


Fixes I can imagine:

1. Firefox will not use gnome-vfs with KDE.

2. I will write just another SuSEconfig script. It will do exactly the same like the current one, but it will prefer Qt/KDE applications instead of GTK/GNOME, read /etc/kde.defaults and save its result into /usr/share/applications/kde/defaults.list or so. Setting an environment variable (either some of GNOME* or XDG*) will force these gnome-vfs2 defaults under KDE.

Well, people using XFCE,... may complain in the same way, so probably rewritten of SuSEconfig scripts may create several versions of

3. Use defaults.list in the home directory generated by the KDE startup scripts.

4. Do the 2., but patch libraries accessing defaults.list. As defaults.list is used by GIO as well, the problem may raise over the time.

Note: XDG code already supports some types of prefixes, so it needs a deeper research before patching.
Comment 10 Wolfgang Rosenauer 2008-12-22 07:24:15 UTC
*** Bug 461362 has been marked as a duplicate of this bug. ***
Comment 11 Christian Trippe 2009-02-21 08:06:52 UTC
I am not sure this bug has the right priority, as bug 461362 (the one marked a duplicate) is in my opinion a usability nightmare.

Every not so experienced user will have problems to view pdf-files running Firefox in KDE (4.1).
Comment 12 Stanislav Brabec 2009-04-29 12:16:55 UTC
*** Bug 494345 has been marked as a duplicate of this bug. ***
Comment 13 Stanislav Brabec 2009-07-29 11:12:27 UTC
Proposed solution:

- Ensure that all applications use XDG_PREFIX for defaults.list.

- Improve update-desktop-database to generate desktop specific defaults.list.

Discussion on the new configuration format:

http://lists.opensuse.org/opensuse-gnome/2009-07/msg00011.html
Comment 14 Stanislav Brabec 2009-10-23 13:07:54 UTC
I did a first steps for the implementation of desktop specific defaults in glib->gtk+->gnome and desktop file utils:

Rewrite of MIME caching code, that will allow future extension:
https://bugzilla.gnome.org/show_bug.cgi?id=596192

Rewrite of update-desktop-database:
Here is a patch, that can generate more that one defaults.list.
http://pack.suse.cz/sbrabec/mime-types/

The full fix is very complex, so 11.2 will not have this fix yet.
Comment 15 Stanislav Brabec 2010-09-20 15:16:20 UTC
I have finally finished the implementation:

desktop environment specific defaults.list: https://bugzilla.gnome.org/show_bug.cgi?id=630171

smart defaults per MIME heuristic: https://bugs.freedesktop.org/show_bug.cgi?id=30214

Testing OBS project:
https://build.opensuse.org/project/show?project=home%3Asbrabec%3Amime-defaults

Packages for testing:
http://download.opensuse.org/repositories/home:/sbrabec:/mime-defaults/openSUSE_11.3/
http://download.opensuse.org/repositories/home:/sbrabec:/mime-defaults/openSUSE_Factory/

Note: I did not yet verify that $DESKTOP_SESSION is set to "kde" in KDE session. If not, it is easy to do.http://download.opensuse.org/repositories/home:/sbrabec:/mime-defaults/openSUSE_Factory/
Comment 16 Stanislav Brabec 2010-09-21 16:29:23 UTC
Created attachment 390777 [details]
gnome_defaults-to-defaults_conf

And here is a draft of the script that will migrate the old SUSE specific /etc/gnome_defaults.conf to the new /etc/xdg/defaults.conf.

With a bit of magic, the migration of customized admin defaults can result customized defaults.conf.

It is a good chance for configuration cleanup: not migrate desktop files of packages that are no more present in openSUSE or SLED.

The final script will probably look a bit different, as the defaults.conf contents is a subject of change and the final configuration may be done in multiple files.
Comment 17 Stanislav Brabec 2011-01-28 14:44:51 UTC
The repository above was refreshed and now contains port for the latest Factory.

It does not contain following things:

- DESKTOP_SESSION variable is not set in all desktops. You have to add it manually to the session init scripts.

- gnome_defaults-to-defaults_conf (comment 16) is not there, so porting of customization of gnome_defaults.conf will not be imported.
Comment 18 Bernhard Wiedemann 2011-10-17 10:00:08 UTC
This is an autogenerated message for OBS integration:
This bug (456026) was mentioned in
https://build.opensuse.org/request/show/88171 Factory / desktop-file-utils
Comment 19 Martín González 2011-12-09 19:09:17 UTC
Fixed in openSUSE 12.1
Comment 20 Stanislav Brabec 2011-12-12 19:57:15 UTC
OK. Let's close this bug.

Anyway, the feature "Desktop Environment Specific Details in GIO/GTK+/GNOME" still waits for upstream review. Without it, SUSE GNOME team refuses to maintain such a large patch in downstream.

Please subscribe to the upstream bug if you are interested.