diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/mainview.cpp | 15 | ||||
-rw-r--r-- | src/mainview.h | 2 |
2 files changed, 9 insertions, 8 deletions
diff --git a/src/mainview.cpp b/src/mainview.cpp index 2ada96e0..eb2ae732 100644 --- a/src/mainview.cpp +++ b/src/mainview.cpp @@ -342,7 +342,7 @@ int MainView::webViewIndex(WebView *webView) const } -WebView *MainView::newWebView(bool makeCurrent) +WebView *MainView::newWebView() { // line edit UrlBar *urlLineEdit = new UrlBar; @@ -399,14 +399,15 @@ WebView *MainView::newWebView(bool makeCurrent) connect(webView, SIGNAL(shiftCtrlTabPressed()), this, SLOT(previousTab())); addTab(webView, i18n("(Untitled)")); - if (makeCurrent) - { - setCurrentWidget(webView); - currentLineEdit()->setFocus(Qt::ActiveWindowFocusReason); - } + setCurrentWidget(webView); + + // FIXME: focus on currentLineEdit just for empty pages + currentLineEdit()->setFocus(Qt::ActiveWindowFocusReason); if (count() == 1) + { currentChanged(currentIndex()); + } emit tabsChanged(); showTabBar(); @@ -486,7 +487,7 @@ void MainView::slotCloneTab(int index) index = currentIndex(); if (index < 0 || index >= count()) return; - WebView *tab = newWebView(false); + WebView *tab = newWebView(); tab->setUrl(webView(index)->url()); showTabBar(); diff --git a/src/mainview.h b/src/mainview.h index 96417d4f..4203e272 100644 --- a/src/mainview.h +++ b/src/mainview.h @@ -99,7 +99,7 @@ protected: public slots: void loadUrlInCurrentTab(const KUrl &url); - WebView *newWebView(bool makeCurrent = true); + WebView *newWebView(); void slotCloneTab(int index = -1); void slotCloseTab(int index = -1); void slotCloseOtherTabs(int index); |