From: Christian Dywan Date: Mon, 10 Oct 2011 19:49:27 +0000 (+0200) Subject: Don't save file dialog folder with GTK+ 3.1.10 X-Git-Url: https://spindle.queued.net/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cb6a4290d68dd87e03fec6cffd12c57da4ec1fd6;p=midori Don't save file dialog folder with GTK+ 3.1.10 The last used folder is restored by default. --- diff --git a/midori/midori-browser.c b/midori/midori-browser.c index 2963faa3..aeed4062 100644 --- a/midori/midori-browser.c +++ b/midori/midori-browser.c @@ -2229,7 +2229,9 @@ static void _action_open_activate (GtkAction* action, MidoriBrowser* browser) { + #if !GTK_CHECK_VERSION (3, 1, 10) static gchar* last_dir = NULL; + #endif gchar* uri = NULL; gboolean folder_set = FALSE; GtkWidget* dialog; @@ -2260,8 +2262,10 @@ _action_open_activate (GtkAction* action, } } + #if !GTK_CHECK_VERSION (3, 1, 10) if (!folder_set && last_dir && *last_dir) gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (dialog), last_dir); + #endif if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_OK) { @@ -2270,10 +2274,11 @@ _action_open_activate (GtkAction* action, folder = gtk_file_chooser_get_current_folder (GTK_FILE_CHOOSER (dialog)); uri = gtk_file_chooser_get_uri (GTK_FILE_CHOOSER (dialog)); midori_browser_set_current_uri (browser, uri); - - g_free (last_dir); - last_dir = folder; g_free (uri); + + #if !GTK_CHECK_VERSION (3, 1, 10) + katze_assign (last_dir, folder); + #endif } gtk_widget_destroy (dialog); }