]> spindle.queued.net Git - midori/commitdiff
Always initialize checkbox in save dialog
authorChristian Dywan <christian@twotoasts.de>
Mon, 6 Aug 2012 23:06:50 +0000 (01:06 +0200)
committerChristian Dywan <christian@twotoasts.de>
Mon, 6 Aug 2012 23:08:25 +0000 (01:08 +0200)
Related: https://bugs.launchpad.net/midori/+bug/1025894

midori/midori-browser.c

index fb9ea2a9560d99c5ce304f8922a4272935498b77..3e32d5a71dd2137262049b19bbd056b4cc654ed9 100644 (file)
@@ -1159,7 +1159,7 @@ midori_browser_save_uri (MidoriBrowser* browser,
     const gchar* title = midori_view_get_display_title (view);
     gchar* filename;
     gboolean file_only = TRUE;
-    GtkWidget* checkbox;
+    GtkWidget* checkbox = NULL;
 
     if (!gtk_widget_get_visible (GTK_WIDGET (browser)))
         return;
@@ -1195,7 +1195,8 @@ midori_browser_save_uri (MidoriBrowser* browser,
     if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_OK)
     {
         filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog));
-        file_only = !file_only && !gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (checkbox));
+        if (checkbox != NULL)
+            file_only = !file_only && !gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (checkbox));
         if (!file_only && !g_str_equal (title, uri))
         {
             gchar* fullname = g_strconcat (filename, ".html", NULL);