]> spindle.queued.net Git - midori/commitdiff
Remove remaining cases checking if browser->settings is set
authorChristian Dywan <christian@twotoasts.de>
Fri, 13 Nov 2009 17:27:49 +0000 (18:27 +0100)
committerChristian Dywan <christian@twotoasts.de>
Fri, 13 Nov 2009 17:27:49 +0000 (18:27 +0100)
midori/midori-browser.c

index ce30fb813c7aa220da3c8c081e1f89ba1658bea0..a0a880b62c695474bf93e13a05b4190e67c3101e 100644 (file)
@@ -226,7 +226,7 @@ _toggle_tabbar_smartly (MidoriBrowser* browser)
         return;
 
     n = gtk_notebook_get_n_pages (GTK_NOTEBOOK (browser->notebook));
-    if (n < 2 && browser->settings)
+    if (n < 2)
     {
         g_object_get (browser->settings, "always-show-tabbar",
             &always_show_tabbar, NULL);
@@ -1275,8 +1275,7 @@ midori_browser_download_notify_status_cb (WebKitDownload* download,
                 g_object_set_data (G_OBJECT (gtk_widget_get_parent (button)),
                                    "done", (void*)1);
 
-            if (browser->settings && katze_object_get_boolean (
-                browser->settings, "notify-transfer-completed"))
+            if (katze_object_get_boolean (browser->settings, "notify-transfer-completed"))
             {
                 const gchar* uri = webkit_download_get_destination_uri (download);
                 gchar* path = soup_uri_decode (uri);
@@ -1630,7 +1629,6 @@ _midori_browser_add_tab (MidoriBrowser* browser,
                       NULL);
 
     if (!g_object_get_data (G_OBJECT (view), "midori-view-append") &&
-        browser->settings &&
         katze_object_get_boolean (browser->settings, "open-tabs-next-to-current"))
     {
         n = gtk_notebook_get_current_page (notebook);
@@ -3060,13 +3058,12 @@ _action_preferences_activate (GtkAction*     action,
 {
     static GtkWidget* dialog = NULL;
 
-    if (!browser->settings || !GTK_WIDGET_VISIBLE (browser))
+    if (!GTK_WIDGET_VISIBLE (browser))
         return;
 
     if (!dialog)
     {
-        dialog = midori_preferences_new (GTK_WINDOW (browser),
-                                         browser->settings);
+        dialog = midori_preferences_new (GTK_WINDOW (browser), browser->settings);
         g_signal_connect (dialog, "response",
             G_CALLBACK (midori_preferences_response_help_cb), browser);
         g_signal_connect (dialog, "destroy",
@@ -3473,17 +3470,14 @@ static void
 _action_homepage_activate (GtkAction*     action,
                            MidoriBrowser* browser)
 {
+    gchar* homepage;
+
     if (g_object_get_data (G_OBJECT (action), "midori-middle-click"))
     {
         g_object_set_data (G_OBJECT (action), "midori-middle-click", (void*)0);
         return;
     }
 
-    gchar* homepage;
-
-    if (!browser->settings)
-        return;
-
     g_object_get (browser->settings, "homepage", &homepage, NULL);
     midori_browser_set_current_uri (browser, homepage);
     g_free (homepage);
@@ -3625,9 +3619,6 @@ _action_search_submit (GtkAction*     action,
     const gchar* url;
     gchar* search;
 
-    if (!browser->settings)
-        return;
-
     g_object_get (browser->settings, "last-web-search", &last_web_search, NULL);
     item = katze_array_get_nth_item (browser->search_engines, last_web_search);
     if (item)
@@ -3915,9 +3906,6 @@ midori_browser_menu_middle_click_on_navigation_action (MidoriBrowser* browser,
 
     g_return_val_if_fail (action != NULL, FALSE);
 
-    if (!browser->settings)
-        return FALSE;
-
     g_object_get (browser->settings, "homepage", &homepage, NULL);
 
     name = gtk_action_get_name (action);
@@ -4411,7 +4399,7 @@ midori_panel_notify_page_cb (MidoriPanel*   panel,
                              MidoriBrowser* browser)
 {
     gint page = katze_object_get_boolean (panel, "page");
-    if (browser->settings && page > -1)
+    if (page > -1)
         g_object_set (browser->settings, "last-panel-page", page, NULL);
 }
 
@@ -4452,8 +4440,7 @@ midori_panel_notify_right_aligned_cb (MidoriPanel*   panel,
     gint paned_position = gtk_paned_get_position (GTK_PANED (hpaned));
     gint paned_size = hpaned->allocation.width;
 
-    g_object_set (browser->settings, "right-align-sidepanel",
-                  right_aligned, NULL);
+    g_object_set (browser->settings, "right-align-sidepanel", right_aligned, NULL);
 
     g_object_ref (browser->panel);
     g_object_ref (vpaned);