summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2012-01-31 10:53:38 +0100
committerAndrea Diamantini <adjam7@gmail.com>2012-01-31 10:53:38 +0100
commit36212edeed4ff4815f7f779bfb1d90f0d07c95a5 (patch)
tree31a1747fab9e11495c9f1a82c86f025d1b8b1ff9
parentList also about:tabs page (diff)
downloadrekonq-36212edeed4ff4815f7f779bfb1d90f0d07c95a5.tar.xz
Update signals/slot between detached tab and its new mainview
Again, sorry for the long waiting... Courtesy patch by vasthusya@gmail.com BUG:273556 REVIEWED-BY: adjam
-rw-r--r--src/mainview.cpp32
1 files changed, 31 insertions, 1 deletions
diff --git a/src/mainview.cpp b/src/mainview.cpp
index 711ee15e..2e187809 100644
--- a/src/mainview.cpp
+++ b/src/mainview.cpp
@@ -755,8 +755,38 @@ void MainView::detachTab(int index, MainWindow *toWindow)
w = rApp->newMainWindow(false);
else
w = toWindow;
- w->mainView()->addTab(tab, rApp->iconManager()->iconForUrl(u), label);
+
+ w->mainView()->addTab(tab, label);
w->mainView()->widgetBar()->insertWidget(0, bar);
w->mainView()->updateTabBar();
+
+ // reconnect signals to the new mainview
+ // Code copied from newWebTab(), any new changes there should be applied here
+
+ // disconnecting webview with old mainview
+ disconnect(tab->view(), SIGNAL(loadStarted()));
+ disconnect(tab->view(), SIGNAL(loadFinished(bool)));
+ disconnect(tab, SIGNAL(titleChanged(const QString &)));
+ disconnect(tab->view(), SIGNAL(urlChanged(const QUrl &)));
+ disconnect(tab->view(), SIGNAL(iconChanged()));
+ disconnect(tab->view(), SIGNAL(openPreviousInHistory()));
+ disconnect(tab->view(), SIGNAL(openNextInHistory()));
+
+ // disconnecting webPage signals with old mainview
+ disconnect(tab->page(), SIGNAL(windowCloseRequested()));
+ disconnect(tab->page(), SIGNAL(printRequested(QWebFrame *)));
+
+ // connecting webview with new mainview
+ connect(tab->view(), SIGNAL(loadStarted()), w->mainView(), SLOT(webViewLoadStarted()));
+ connect(tab->view(), SIGNAL(loadFinished(bool)), w->mainView(), SLOT(webViewLoadFinished(bool)));
+ connect(tab, SIGNAL(titleChanged(const QString &)), w->mainView(), SLOT(webViewTitleChanged(const QString &)));
+ connect(tab->view(), SIGNAL(urlChanged(const QUrl &)), w->mainView(), SLOT(webViewUrlChanged(const QUrl &)));
+ connect(tab->view(), SIGNAL(iconChanged()), w->mainView(), SLOT(webViewIconChanged()));
+ connect(tab->view(), SIGNAL(openPreviousInHistory()), w->mainView(), SIGNAL(openPreviousInHistory()));
+ connect(tab->view(), SIGNAL(openNextInHistory()), w->mainView(), SIGNAL(openNextInHistory()));
+
+ // connecting webPage signals with new mainview
+ connect(tab->page(), SIGNAL(windowCloseRequested()), w->mainView(), SLOT(windowCloseRequested()));
+ connect(tab->page(), SIGNAL(printRequested(QWebFrame *)), w->mainView(), SIGNAL(printRequested(QWebFrame *)));
}
}