From c60a9d220a731abc37b80cfded22acb4655a48a5 Mon Sep 17 00:00:00 2001 From: Christian Dywan Date: Sun, 20 Nov 2011 22:19:08 +0100 Subject: [PATCH] Tweak last_folder handling to avoid warnings --- midori/midori-browser.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/midori/midori-browser.c b/midori/midori-browser.c index 4aea650e..f93a66cf 100644 --- a/midori/midori-browser.c +++ b/midori/midori-browser.c @@ -2251,9 +2251,9 @@ _action_open_activate (GtkAction* action, { #if !GTK_CHECK_VERSION (3, 1, 10) static gchar* last_dir = NULL; + gboolean folder_set = FALSE; #endif gchar* uri = NULL; - gboolean folder_set = FALSE; GtkWidget* dialog; GtkWidget* view; @@ -2274,7 +2274,9 @@ _action_open_activate (GtkAction* action, if (dirname && g_file_test (dirname, G_FILE_TEST_IS_DIR)) { gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (dialog), dirname); + #if !GTK_CHECK_VERSION (3, 1, 10) folder_set = TRUE; + #endif } g_free (dirname); @@ -2289,16 +2291,15 @@ _action_open_activate (GtkAction* action, if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_OK) { + #if !GTK_CHECK_VERSION (3, 1, 10) gchar* folder; - folder = gtk_file_chooser_get_current_folder (GTK_FILE_CHOOSER (dialog)); + katze_assign (last_dir, folder); + #endif uri = gtk_file_chooser_get_uri (GTK_FILE_CHOOSER (dialog)); midori_browser_set_current_uri (browser, uri); g_free (uri); - #if !GTK_CHECK_VERSION (3, 1, 10) - katze_assign (last_dir, folder); - #endif } gtk_widget_destroy (dialog); } -- 2.39.5