1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 02:36:34 +01:00

[Fix:] Opening link (target=blank) in new selected tab (regression)

This commit is contained in:
nowrep 2011-12-05 16:12:48 +01:00
parent 820e87594f
commit d5c9b40601
3 changed files with 5 additions and 5 deletions

View File

@ -245,7 +245,7 @@ int TabWidget::addView(QUrl url, const QString &title, OpenUrlIn openIn, bool se
{
m_lastTabIndex = currentIndex();
if (url.isEmpty() && openIn != CleanPage) {
if (url.isEmpty() && openIn != CleanPage && openIn != CleanSelectedPage) {
url = m_urlOnNewTab;
}
@ -259,7 +259,7 @@ int TabWidget::addView(QUrl url, const QString &title, OpenUrlIn openIn, bool se
webView->animationLoading(index, true)->movie()->stop();
webView->animationLoading(index, false)->setPixmap(_iconForUrl(url).pixmap(16, 16));
if (openIn == TabWidget::NewSelectedTab) {
if (openIn == NewSelectedTab || openIn == CleanSelectedPage) {
setCurrentIndex(index);
}
@ -289,7 +289,7 @@ int TabWidget::addView(QUrl url, const QString &title, OpenUrlIn openIn, bool se
p_QupZilla->locationBar()->setFocus();
}
if (openIn == NewSelectedTab) {
if (openIn == NewSelectedTab || openIn == CleanSelectedPage) {
m_isClosingToLastTabIndex = true;
m_locationBars->setCurrentWidget(locBar);
}

View File

@ -43,7 +43,7 @@ class TabWidget : public QTabWidget
public:
explicit TabWidget(QupZilla* mainclass, QWidget* parent = 0);
~TabWidget();
enum OpenUrlIn { CurrentTab, NewSelectedTab, NewNotSelectedTab, NewTab = NewSelectedTab, CleanPage };
enum OpenUrlIn { CurrentTab, NewSelectedTab, NewNotSelectedTab, NewTab = NewSelectedTab, CleanPage, CleanSelectedPage };
QByteArray saveState();
bool restoreState(const QByteArray &state);

View File

@ -213,7 +213,7 @@ QWebPage* WebPage::createWindow(QWebPage::WebWindowType type)
// view->show();
// return view->page();
Q_UNUSED(type);
int index = p_QupZilla->tabWidget()->addView(QUrl(), tr("New tab"), TabWidget::CleanPage);
int index = p_QupZilla->tabWidget()->addView(QUrl(), tr("New tab"), TabWidget::CleanSelectedPage);
return p_QupZilla->weView(index)->page();
}