diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/application.cpp | 25 | ||||
-rw-r--r-- | src/application.h | 4 | ||||
-rw-r--r-- | src/mainview.cpp | 3 |
3 files changed, 27 insertions, 5 deletions
diff --git a/src/application.cpp b/src/application.cpp index e0570a5b..48fb1a3e 100644 --- a/src/application.cpp +++ b/src/application.cpp @@ -450,16 +450,15 @@ SyncManager *Application::syncManager() return m_syncManager.data(); } - -void Application::loadUrl(const KUrl& url, const Rekonq::OpenType& type) +WebTab* Application::loadUrl(const KUrl& url, QWebHistory* webHistory, const Rekonq::OpenType& type) { if (url.isEmpty()) - return; + return 0; if (!url.isValid()) { KMessageBox::error(0, i18n("Malformed URL:\n%1", url.url(KUrl::RemoveTrailingSlash))); - return; + return 0; } Rekonq::OpenType newType = type; @@ -517,6 +516,24 @@ void Application::loadUrl(const KUrl& url, const Rekonq::OpenType& type) FilterUrlJob *job = new FilterUrlJob(view, url.pathOrUrl(), this); Weaver::instance()->enqueue(job); } + + if (webHistory) + { + QByteArray historyBytes; + QDataStream historyStream(&historyBytes, QIODevice::ReadWrite); + + historyStream << *webHistory; + historyStream.device()->seek(0); + historyStream >> *(view->history()); + } + + return tab; +} + + +void Application::loadUrl(const KUrl& url, const Rekonq::OpenType& type) +{ + Q_UNUSED(loadUrl(url, 0, type)); } diff --git a/src/application.h b/src/application.h index 2689e3f5..5e078756 100644 --- a/src/application.h +++ b/src/application.h @@ -43,6 +43,7 @@ #include <QtCore/QDateTime> #include <QtCore/QWeakPointer> +class QWebHistory; // Forward Declarations class AdBlockManager; @@ -55,6 +56,7 @@ class OpenSearchManager; class SessionManager; class UserAgentManager; class SyncManager; +class WebTab; class KAction; @@ -104,6 +106,8 @@ public: { return _privateBrowsingAction; }; + + WebTab *loadUrl(const KUrl& url, QWebHistory *webHistory, const Rekonq::OpenType& type = Rekonq::CurrentTab); public Q_SLOTS: /** diff --git a/src/mainview.cpp b/src/mainview.cpp index 19e5531d..9fa4d049 100644 --- a/src/mainview.cpp +++ b/src/mainview.cpp @@ -414,8 +414,9 @@ void MainView::cloneTab(int index) return; KUrl url = webTab(index)->url(); + QWebHistory * history = webTab(index)->view()->history(); - rApp->loadUrl(url, Rekonq::NewTab); + rApp->loadUrl(url, history, Rekonq::NewTab); } |