diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2012-01-04 18:47:37 +0100 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2012-01-04 18:47:37 +0100 |
commit | 218b5df8db37ea45e0f145a3400589a725a15658 (patch) | |
tree | a5fec621121726917c89e84346905d188e6c3e89 /src | |
parent | Reorder suggestions list, taking on a "relevant" list (diff) | |
download | rekonq-218b5df8db37ea45e0f145a3400589a725a15658.tar.xz |
Manage rekonq pages in "current" NOT "main" frame
Also double check for strange about urls
BUG: 290411
Diffstat (limited to 'src')
-rw-r--r-- | src/newtabpage.cpp | 13 | ||||
-rw-r--r-- | src/protocolhandler.cpp | 4 | ||||
-rw-r--r-- | src/protocolhandler.h | 2 |
3 files changed, 11 insertions, 8 deletions
diff --git a/src/newtabpage.cpp b/src/newtabpage.cpp index 00c7f81d..a073117c 100644 --- a/src/newtabpage.cpp +++ b/src/newtabpage.cpp @@ -182,13 +182,16 @@ void NewTabPage::generate(const KUrl &url) } // webFrame can be null. See bug:282092 - if (!m_root.webFrame()) + QWebFrame *parentFrame = qobject_cast<QWebFrame *>(parent()); + if (!parentFrame) + { + kDebug() << "NULL PARENT FRAME: PAGE NOT LOADED"; return; - WebPage *page = qobject_cast <WebPage *>(m_root.webFrame()->page()); - page->mainFrame()->setHtml(m_html); - page->setIsOnRekonqPage(true); + } + + parentFrame->setHtml(m_html); - m_root = page->mainFrame()->documentElement().findFirst(QL1S("#content")); + m_root = parentFrame->documentElement().findFirst(QL1S("#content")); browsingMenu(url); diff --git a/src/protocolhandler.cpp b/src/protocolhandler.cpp index ebb12e8f..9489f025 100644 --- a/src/protocolhandler.cpp +++ b/src/protocolhandler.cpp @@ -2,7 +2,7 @@ * * This file is a part of the rekonq project * -* Copyright (C) 2010-2011 by Andrea Diamantini <adjam7 at gmail dot com> +* Copyright (C) 2010-2012 by Andrea Diamantini <adjam7 at gmail dot com> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -136,7 +136,7 @@ bool ProtocolHandler::preHandling(const QNetworkRequest &request, QWebFrame *fra { QByteArray encodedUrl = _url.toEncoded(); // let webkit manage the about:blank url... - if (encodedUrl == QByteArray("about:blank")) + if (encodedUrl.startsWith(QByteArray("about:blank"))) { return false; } diff --git a/src/protocolhandler.h b/src/protocolhandler.h index a4ee61e4..80f37dfc 100644 --- a/src/protocolhandler.h +++ b/src/protocolhandler.h @@ -2,7 +2,7 @@ * * This file is a part of the rekonq project * -* Copyright (C) 2010-2011 by Andrea Diamantini <adjam7 at gmail dot com> +* Copyright (C) 2010-2012 by Andrea Diamantini <adjam7 at gmail dot com> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as |