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 684830 - Adding file to archive, file-roller doesn't load location correctly and then crash
Adding file to archive, file-roller doesn't load location correctly and then ...
Status: RESOLVED FIXED
Product: file-roller
Classification: Applications
Component: general
3.5.x
Other Linux
: Normal normal
: ---
Assigned To: Paolo Bacchilega
file-roller-maint
Depends on:
Blocks:
 
 
Reported: 2012-09-25 22:14 UTC by OKANO Takayoshi
Modified: 2012-09-27 18:35 UTC
See Also:
GNOME target: ---
GNOME version: 3.5/3.6


Attachments
Fix doesn't load location when current-folder is empty. (1.01 KB, patch)
2012-09-27 13:35 UTC, Mitsuya Shibata
none Details | Review

Description OKANO Takayoshi 2012-09-25 22:14:42 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.
Comment 1 Mitsuya Shibata 2012-09-27 13:35:01 UTC
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.
Comment 2 Paolo Bacchilega 2012-09-27 18:35:03 UTC
patch applied to the master branch, thank you.