diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2010-04-24 16:21:10 +0200 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2010-04-24 16:21:10 +0200 |
commit | 6d9f18a4ff82fa620d35f21da32c6a7bea7f0eaf (patch) | |
tree | ccf989ddf8a4894f04eda825fcb5845358be5106 /src/mainview.cpp | |
parent | Dramatically improved "detach tab" performances.. (diff) | |
download | rekonq-6d9f18a4ff82fa620d35f21da32c6a7bea7f0eaf.tar.xz |
Detach tab. last fixes.
- Do not detach one tab windows
- let detach work with "about" urls
Diffstat (limited to 'src/mainview.cpp')
-rw-r--r-- | src/mainview.cpp | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/src/mainview.cpp b/src/mainview.cpp index 3adc0ec9..63c10683 100644 --- a/src/mainview.cpp +++ b/src/mainview.cpp @@ -687,16 +687,25 @@ void MainView::detachTab(int index) return; WebTab *tab = webTab(index); - QString label = tab->view()->title(); - QWidget *bar = _bars->widget(index); - - closeTab(index, false); - - MainWindow *w = Application::instance()->newMainWindow(false); - w->mainView()->addTab(tab, Application::icon(tab->url()), label); - QStackedWidget *stack = qobject_cast<QStackedWidget *>(w->mainView()->urlBarWidget()); - stack->insertWidget(0, bar); - w->mainView()->updateTabBar(); + KUrl u = tab->url(); + kDebug() << u; + if( u.scheme() == QL1S("about") ) + { + closeTab(index); + Application::instance()->loadUrl(u, Rekonq::NewWindow); + } + else + { + QString label = tab->view()->title(); + QWidget *bar = _bars->widget(index); + closeTab(index, false); + + MainWindow *w = Application::instance()->newMainWindow(false); + w->mainView()->addTab(tab, Application::icon( u ), label); + QStackedWidget *stack = qobject_cast<QStackedWidget *>(w->mainView()->urlBarWidget()); + stack->insertWidget(0, bar); + w->mainView()->updateTabBar(); + } } |