summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorinfirit <[email protected]>2014-11-19 14:34:45 +0100
committerinfirit <[email protected]>2014-11-19 15:44:09 +0100
commita69bffe496b5ef8de806915adfa76826be1b9e9e (patch)
treeed0f51077fe5e2016f0e743c07e0d1b78030d943
parent4f7a774746b0957e8b62e41f27a82b543b6ccf5a (diff)
downloadengrampa-a69bffe496b5ef8de806915adfa76826be1b9e9e.tar.bz2
engrampa-a69bffe496b5ef8de806915adfa76826be1b9e9e.tar.xz
Fixed crash when clicking Cancel in Add Files
This reworks the patch already taken from gnome bug 631472 as there is more done in the commit that makes sense. Taken from FR commit: 77e9b777042c557c961f058ecab2691a4fd19a62 From: Paolo Bacchilega <[email protected]> Gnome bug: http://bugzilla.gnome.org/show_bug.cgi?id=631472
-rw-r--r--src/dlg-add-files.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/dlg-add-files.c b/src/dlg-add-files.c
index 7ece634..03f3828 100644
--- a/src/dlg-add-files.c
+++ b/src/dlg-add-files.c
@@ -64,15 +64,18 @@ file_sel_response_cb (GtkWidget *widget,
current_folder = gtk_file_chooser_get_current_folder_uri (file_sel);
uri = gtk_file_chooser_get_uri (file_sel);
- g_settings_set_string (data->settings, PREF_ADD_CURRENT_FOLDER, current_folder);
+
+ if (current_folder != NULL) {
+ g_settings_set_string (data->settings, PREF_ADD_CURRENT_FOLDER, current_folder);
+ fr_window_set_add_default_dir (window, current_folder);
+ }
if (uri != NULL)
{
g_settings_set_string (data->settings, PREF_ADD_FILENAME, uri);
+ g_free (uri);
}
- fr_window_set_add_default_dir (window, current_folder);
- g_free (uri);
if ((response == GTK_RESPONSE_CANCEL) || (response == GTK_RESPONSE_DELETE_EVENT)) {
gtk_widget_destroy (data->dialog);