After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 166658 - Archives should only be processed if command-line utility is present
Archives should only be processed if command-line utility is present
Status: RESOLVED FIXED
Product: file-roller
Classification: Applications
Component: general
2.6.x
Other All
: Normal normal
: ---
Assigned To: Paolo Bacchilega
Paolo Bacchilega
Depends on:
Blocks: 162104
 
 
Reported: 2005-02-08 12:15 UTC by laszlo.kovacs
Modified: 2005-02-27 20:11 UTC
See Also:
GNOME target: ---
GNOME version: 2.9/2.10


Attachments
patch with fix (32.85 KB, patch)
2005-02-16 17:07 UTC, laszlo.kovacs
none Details | Review

Description laszlo.kovacs 2005-02-08 12:15:07 UTC
Please describe the problem:
When creating a new archive the drop down list containing the archive types is
hardcoded. I think this should be dynamically filled at startup based on the
relevant utilities being installed (in the PATH).

Steps to reproduce:
1. Start file-roller
2. Create new archive (click on New)
3. In the archive type drop down menu (in the file selector open when clicked on
New) there are a number of archive types, they are always the same regardless of
the relevant utility being installed.


Actual results:


Expected results:


Does this happen every time?


Other information:
Comment 1 laszlo.kovacs 2005-02-16 17:07:51 UTC
Created attachment 37551 [details] [review]
patch with fix
Comment 2 laszlo.kovacs 2005-02-16 17:16:18 UTC
This patch fixes the problem described above.

I had to change things in three areas:

1. I changed all command classes to create a valid command only if the relevant
utility is available. This fixes the opening of archives, drag and drop from
Nautilus and batch processing.

2. The combo box in New and Save As dialogs (actions.c) is now dynamically
created at startup. Also the filters on New, Save As and Open dialogs as well.
This is done in get_supported_archive_types().

3. I added a check before removing to be overwritten files in the New and Save
As dialogs so that if an existing unsupported (no command line utility) archive
name is typed in by the user (to be overwritten) then we do not remove it as we
can not create it again.

Hope this helps, let me know what you think.
Comment 3 Paolo Bacchilega 2005-02-16 18:18:04 UTC
The patch looks good, and has been applied to current CVS, thank you.  

I'd make only two changes before closing the bug:

1) use is_program_in_path in actions.c:get_supported_archive_types instead of
g_find_program_in_path
2) make is_program_in_path() save the results in a local cache to speed up things.

Comment 4 Paolo Bacchilega 2005-02-19 16:35:25 UTC
done.