GNOME Bugzilla – Bug 166658
Archives should only be processed if command-line utility is present
Last modified: 2005-02-27 20:11:54 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:
Created attachment 37551 [details] [review] patch with fix
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.
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.
done.