summaryrefslogtreecommitdiff
path: root/src/mainview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mainview.cpp')
-rw-r--r--src/mainview.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/mainview.cpp b/src/mainview.cpp
index 0eb292ef..413d1b45 100644
--- a/src/mainview.cpp
+++ b/src/mainview.cpp
@@ -87,7 +87,8 @@ MainView::MainView(MainWindow *parent)
connect(m_tabBar, SIGNAL(closeOtherTabs(int)), this, SLOT(closeOtherTabs(int)));
connect(m_tabBar, SIGNAL(reloadTab(int)), this, SLOT(reloadTab(int)));
connect(m_tabBar, SIGNAL(reloadAllTabs()), this, SLOT(reloadAllTabs()));
-
+ connect(m_tabBar, SIGNAL(detachTab(int)), this, SLOT(detachTab(int)));
+
connect(m_tabBar, SIGNAL(tabCloseRequested(int)), this, SLOT(closeTab(int)));
// current page index changing
@@ -648,3 +649,17 @@ void MainView::resizeEvent(QResizeEvent *event)
updateTabBar();
KTabWidget::resizeEvent(event);
}
+
+
+void MainView::detachTab(int index)
+{
+ if (index < 0)
+ index = currentIndex();
+ if (index < 0 || index >= count())
+ return;
+
+ KUrl url = webTab(index)->view()->url();
+ closeTab(index);
+
+ Application::instance()->loadUrl(url, Rekonq::NewWindow);
+}