From 93e7c073d44d812af7217efc87a293dc8cbf1707 Mon Sep 17 00:00:00 2001 From: nowrep Date: Thu, 29 Dec 2011 15:45:29 +0100 Subject: [PATCH] [Fix:] Going to history items from history back/forward menu in new tab - fixed regression from 061e1e21543b3cfd323fa901992328e14a9f36d2 --- src/bookmarks/bookmarkstoolbar.cpp | 1 - src/navigation/navigationbar.cpp | 3 +-- src/webview/tabwidget.cpp | 4 +++- src/webview/tabwidget.h | 5 +++-- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/bookmarks/bookmarkstoolbar.cpp b/src/bookmarks/bookmarkstoolbar.cpp index d632b5570..d544abc9f 100644 --- a/src/bookmarks/bookmarkstoolbar.cpp +++ b/src/bookmarks/bookmarkstoolbar.cpp @@ -48,7 +48,6 @@ BookmarksToolbar::BookmarksToolbar(QupZilla* mainClass, QWidget* parent) connect(m_bookmarksModel, SIGNAL(folderDeleted(QString)), this, SLOT(folderDeleted(QString))); connect(m_bookmarksModel, SIGNAL(folderRenamed(QString, QString)), this, SLOT(folderRenamed(QString, QString))); - setMaximumWidth(p_QupZilla->width()); // QTimer::singleShot(0, this, SLOT(refreshBookmarks())); diff --git a/src/navigation/navigationbar.cpp b/src/navigation/navigationbar.cpp index e106a6f43..4f748703a 100644 --- a/src/navigation/navigationbar.cpp +++ b/src/navigation/navigationbar.cpp @@ -261,9 +261,8 @@ void NavigationBar::goAtHistoryIndexInNewTab(int index) } TabWidget* tabWidget = p_QupZilla->tabWidget(); - tabWidget->duplicateTab(tabWidget->currentIndex()); + int tabIndex = tabWidget->duplicateTab(tabWidget->currentIndex()); - int tabIndex = tabWidget->count() - 1; QWebHistory* history = p_QupZilla->weView(tabIndex)->page()->history(); history->goToItem(history->itemAt(index)); diff --git a/src/webview/tabwidget.cpp b/src/webview/tabwidget.cpp index 89ad43ed1..5c72551dd 100644 --- a/src/webview/tabwidget.cpp +++ b/src/webview/tabwidget.cpp @@ -419,7 +419,7 @@ void TabWidget::closeAllButCurrent(int index) } } -void TabWidget::duplicateTab(int index) +int TabWidget::duplicateTab(int index) { QUrl url = weView(index)->url(); QByteArray history; @@ -429,6 +429,8 @@ void TabWidget::duplicateTab(int index) int id = addView(url, tabText(index), TabWidget::NewNotSelectedTab); QDataStream historyStream(history); historyStream >> *weView(id)->history(); + + return id; } void TabWidget::restoreClosedTab() diff --git a/src/webview/tabwidget.h b/src/webview/tabwidget.h index 0be6d87b5..c196d4478 100644 --- a/src/webview/tabwidget.h +++ b/src/webview/tabwidget.h @@ -68,14 +68,15 @@ signals: void pinnedTabAdded(); public slots: - void closeTab(int index = -1); int addView(QUrl url = QUrl(), const QString &title = tr("New tab"), OpenUrlIn openIn = NewTab, bool selectLine = false, int position = -1); + int duplicateTab(int index); + + void closeTab(int index = -1); void reloadTab(int index) { weView(index)->reload(); } void reloadAllTabs(); void stopTab(int index) { weView(index)->stop(); } void backTab(int index) { weView(index)->back(); } void forwardTab(int index) { weView(index)->forward(); } - void duplicateTab(int index); void closeAllButCurrent(int index); void restoreClosedTab(); void restoreAllClosedTabs();