summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2009-11-13 02:40:11 +0100
committerAndrea Diamantini <adjam7@gmail.com>2009-11-13 02:40:11 +0100
commitb31d522e9f39e90576a3bc46f912077d5acd1c99 (patch)
treed18c9429bc5e141ad4eaaa844314a7cbe42b2dd2
parentFixing about: protocol loading. (diff)
downloadrekonq-b31d522e9f39e90576a3bc46f912077d5acd1c99.tar.xz
This hack seems solve the about: protocol loading problem
also in Qt 4.6. Hope it works really well :)
-rw-r--r--src/mainwindow.cpp6
-rw-r--r--src/mainwindow.h3
-rw-r--r--src/webpage.cpp3
3 files changed, 9 insertions, 3 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 770df91d..7a9e3ad6 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -103,6 +103,7 @@ MainWindow::MainWindow()
, m_popup( new KPassivePopup(this) )
, m_hidePopup( new QTimer(this) )
, m_ac( new KActionCollection(this) )
+ , m_loadingNewTabPage(false)
{
// enable window size "auto-save"
setAutoSaveSettings();
@@ -1113,6 +1114,9 @@ void MainWindow::openActionUrl(QAction *action)
bool MainWindow::newTabPage(const KUrl &url)
{
+ if(m_loadingNewTabPage)
+ return false;
+
if ( url == KUrl("about:closedTabs")
|| url == KUrl("about:history")
|| url == KUrl("about:bookmarks")
@@ -1120,11 +1124,13 @@ bool MainWindow::newTabPage(const KUrl &url)
|| url == KUrl("about:home")
)
{
+ m_loadingNewTabPage = true;
kDebug() << "loading home: " << url;
WebView *w = currentTab();
NewTabPage p;
QString html = p.newTabPageCode(url);
w->setHtml(html, url);
+ m_loadingNewTabPage = false;
return true;
}
return false;
diff --git a/src/mainwindow.h b/src/mainwindow.h
index d1a48053..5071cdb2 100644
--- a/src/mainwindow.h
+++ b/src/mainwindow.h
@@ -172,7 +172,8 @@ private:
QTimer *m_hidePopup;
KActionCollection *m_ac;
-
+
+ bool m_loadingNewTabPage;
};
#endif // MAINWINDOW_H
diff --git a/src/webpage.cpp b/src/webpage.cpp
index 3400564e..56865eb7 100644
--- a/src/webpage.cpp
+++ b/src/webpage.cpp
@@ -116,9 +116,8 @@ bool WebPage::acceptNavigationRequest(QWebFrame *frame, const QNetworkRequest &r
if (request.url().scheme() == QLatin1String("about"))
{
- kDebug() << "loading " << request.url();
Application::instance()->mainWindow()->newTabPage( request.url() );
- return false;
+ return true;
}
m_requestedUrl = request.url();