GNOME Bugzilla – Bug 684830
Adding file to archive, file-roller doesn't load location correctly and then crash
Last modified: 2012-09-27 18:35:03 UTC
reported in https://bugs.launchpad.net/ubuntu/+source/file-roller/+bug/1056261 and confirmed as a non-ubuntu-specific problem. how to reproduce: 1. open an archive file (e.g. hoge.tgz) with file-roller 2. Hit "Add files" button 3. It appears the file selection dialog box, and "Could not load the location" error dialog 4. close "Could not load the location" dialog 5. select a place on left pain of the file selection dialog, it causes crash (segmentation fault) environment: Ubuntu 12.10 beta1 + file-roller 3.5.92 Reason: If current-folder is ''(emty string, not NULL), will call g_file_new_for_uri('') in src/dlg-add.c and its return vallue(GFile object) is passed to first argument of g_directory_foreach_child(directory, ...). In the result, will occure "Could not load the location" error. Workaround: 1. Close "Could not load the location" dialogue. 2. Select any folder in file selection dialogue. 3. No error message any more. Solution: Plan A) Change default schema from '' to any other valid path for current-folder in data/org.gnome.FileRoller.gschema.xml.in. Plan B) If base_dir is '' in dlg_add_folder_load_last_options(), set any other valid path.
Created attachment 225258 [details] [review] Fix doesn't load location when current-folder is empty. This patch initialize folder with NULL, and call g_file_new_for_uri() only when /org/gnome/FileRoller/Dialogs/Add/current-folder is not empty. If folder is NULL, assign return value of fr_window_get_add_default_dir(), normally user's home folder, to folder variable. This logic is same as version 3.4.1.
patch applied to the master branch, thank you.