From cd05d0a3513dfbfc2e82042b4eee66cbaecbb91e Mon Sep 17 00:00:00 2001 From: Christian Dywan Date: Thu, 8 Dec 2011 21:14:06 +0100 Subject: [PATCH] Use new _with_item constructor everywhere --- midori/main.c | 2 +- midori/midori-browser.c | 6 +++--- midori/midori-view.c | 12 +++++------- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/midori/main.c b/midori/main.c index 2849e9dc..9e4d622f 100644 --- a/midori/main.c +++ b/midori/main.c @@ -2204,7 +2204,7 @@ main (int argc, GtkWidget* offscreen = gtk_offscreen_window_new (); #endif gchar* msg = NULL; - GtkWidget* view = midori_view_new_with_title (NULL, settings, FALSE); + GtkWidget* view = midori_view_new_with_item (NULL, settings); g_object_set (settings, "open-new-pages-in", MIDORI_NEW_PAGE_WINDOW, NULL); midori_browser_add_tab (browser, view); #if 0 /* HAVE_OFFSCREEN */ diff --git a/midori/midori-browser.c b/midori/midori-browser.c index ea065280..f07c4a9e 100644 --- a/midori/midori-browser.c +++ b/midori/midori-browser.c @@ -3423,7 +3423,7 @@ _action_source_view_activate (GtkAction* action, source_uri = g_filename_to_uri (filename, NULL, NULL); g_free (filename); - source = midori_view_new_with_title (NULL, browser->settings, FALSE); + source = midori_view_new_with_item (NULL, browser->settings); source_view = midori_view_get_web_view (MIDORI_VIEW (source)); webkit_web_view_set_view_source_mode (WEBKIT_WEB_VIEW (source_view), TRUE); webkit_web_view_load_uri (WEBKIT_WEB_VIEW (source_view), source_uri); @@ -4684,8 +4684,8 @@ _action_tab_duplicate_activate (GtkAction* action, { GtkWidget* view = midori_browser_get_current_tab (browser); MidoriNewView where = MIDORI_NEW_VIEW_TAB; - GtkWidget* new_view = midori_view_new_with_title ( - NULL, browser->settings, FALSE); + GtkWidget* new_view = midori_view_new_with_item ( + midori_view_get_proxy_item (MIDORI_VIEW (view)), browser->settings); const gchar* uri = midori_view_get_display_uri (MIDORI_VIEW (view)); g_signal_emit_by_name (view, "new-view", new_view, where, TRUE); midori_view_set_uri (MIDORI_VIEW (new_view), uri); diff --git a/midori/midori-view.c b/midori/midori-view.c index 7be958a8..6d996eac 100644 --- a/midori/midori-view.c +++ b/midori/midori-view.c @@ -2701,8 +2701,7 @@ webkit_web_view_create_web_view_cb (GtkWidget* web_view, new_view = view; else { - new_view = (MidoriView*)midori_view_new_with_title (NULL, - view->settings, FALSE); + new_view = (MidoriView*)midori_view_new_with_item (NULL, view->settings); g_signal_connect (new_view->web_view, "web-view-ready", G_CALLBACK (webkit_web_view_web_view_ready_cb), view); } @@ -3206,7 +3205,7 @@ midori_view_focus_in_event (GtkWidget* widget, * * Return value: a new #MidoriView * - * Deprecated: 0.2.8: Use midori_view_new_with_title() instead. + * Deprecated: 0.2.8: Use midori_view_new_with_item() instead. **/ GtkWidget* midori_view_new (KatzeNet* net) @@ -3261,6 +3260,7 @@ _midori_view_set_settings (MidoriView* view, * Return value: a new #MidoriView * * Since: 0.3.0 + * Deprecated: 0.4.3 **/ GtkWidget* midori_view_new_with_title (const gchar* title, @@ -4293,11 +4293,9 @@ midori_view_tab_label_menu_duplicate_tab_cb (GtkWidget* menuitem, MidoriView* view) { MidoriNewView where = MIDORI_NEW_VIEW_TAB; - GtkWidget* new_view = midori_view_new_with_title ( - NULL, view->settings, FALSE); - const gchar* uri = midori_view_get_display_uri (MIDORI_VIEW (view)); + GtkWidget* new_view = midori_view_new_with_item (view->item, view->settings); g_signal_emit (view, signals[NEW_VIEW], 0, new_view, where, TRUE); - midori_view_set_uri (MIDORI_VIEW (new_view), uri); + midori_view_set_uri (MIDORI_VIEW (new_view), view->uri); } static void