summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorMartin Smith <martin.smith@nokia.com>2010-06-16 12:49:45 (GMT)
committerMartin Smith <martin.smith@nokia.com>2010-06-16 12:49:45 (GMT)
commitdf3883b1dae79598e7d5f6b470c876de9cfc8bf2 (patch)
tree71e87f8167512d04b6142dc84a6e54b71940b4a9 /tools
parent00e3c4d7dcb5f14e9d13200a1e5d041d266f6610 (diff)
parent3d03e0a1fdd04e1ab97ba0f95a3a934c879d047e (diff)
downloadQt-df3883b1dae79598e7d5f6b470c876de9cfc8bf2.zip
Qt-df3883b1dae79598e7d5f6b470c876de9cfc8bf2.tar.gz
Qt-df3883b1dae79598e7d5f6b470c876de9cfc8bf2.tar.bz2
Merge branch '4.7' of git@scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7
Diffstat (limited to 'tools')
-rw-r--r--tools/assistant/tools/assistant/helpviewer_qwv.cpp23
-rw-r--r--tools/assistant/tools/assistant/helpviewer_qwv.h3
-rw-r--r--tools/shared/symbian/epocroot.cpp4
3 files changed, 24 insertions, 6 deletions
diff --git a/tools/assistant/tools/assistant/helpviewer_qwv.cpp b/tools/assistant/tools/assistant/helpviewer_qwv.cpp
index 244d091..dcbbf2c 100644
--- a/tools/assistant/tools/assistant/helpviewer_qwv.cpp
+++ b/tools/assistant/tools/assistant/helpviewer_qwv.cpp
@@ -172,6 +172,7 @@ private:
bool closeNewTabIfNeeded;
friend class HelpViewer;
+ QUrl m_loadingUrl;
Qt::MouseButtons m_pressedButtons;
Qt::KeyboardModifiers m_keyboardModifiers;
};
@@ -232,6 +233,11 @@ bool HelpPage::acceptNavigationRequest(QWebFrame *,
return false;
}
+ m_loadingUrl = url; // because of async page loading, we will hit some kind
+ // of race condition while using a remote command, like a combination of
+ // SetSource; SyncContent. SetSource would be called and SyncContents shortly
+ // afterwards, but the page might not have finished loading and the old url
+ // would be returned.
return true;
}
@@ -268,6 +274,7 @@ HelpViewer::HelpViewer(CentralWidget *parent, qreal zoom)
connect(page(), SIGNAL(linkHovered(QString,QString,QString)), this,
SIGNAL(highlighted(QString)));
connect(this, SIGNAL(urlChanged(QUrl)), this, SIGNAL(sourceChanged(QUrl)));
+ connect(this, SIGNAL(loadStarted()), this, SLOT(setLoadStarted()));
connect(this, SIGNAL(loadFinished(bool)), this, SLOT(setLoadFinished(bool)));
connect(page(), SIGNAL(printRequested(QWebFrame*)), this, SIGNAL(printRequested()));
@@ -333,10 +340,19 @@ bool HelpViewer::handleForwardBackwardMouseButtons(QMouseEvent *e)
return false;
}
+QUrl HelpViewer::source() const
+{
+ HelpPage *currentPage = static_cast<HelpPage*> (page());
+ if (currentPage && !hasLoadFinished()) {
+ // see HelpPage::acceptNavigationRequest(...)
+ return currentPage->m_loadingUrl;
+ }
+ return url();
+}
+
void HelpViewer::setSource(const QUrl &url)
{
TRACE_OBJ
- loadFinished = false;
load(url.toString() == QLatin1String("help") ? LocalHelpFile : url);
}
@@ -396,6 +412,11 @@ void HelpViewer::mousePressEvent(QMouseEvent *event)
QWebView::mousePressEvent(event);
}
+void HelpViewer::setLoadStarted()
+{
+ loadFinished = false;
+}
+
void HelpViewer::setLoadFinished(bool ok)
{
TRACE_OBJ
diff --git a/tools/assistant/tools/assistant/helpviewer_qwv.h b/tools/assistant/tools/assistant/helpviewer_qwv.h
index 2577828..1897e3e 100644
--- a/tools/assistant/tools/assistant/helpviewer_qwv.h
+++ b/tools/assistant/tools/assistant/helpviewer_qwv.h
@@ -71,8 +71,8 @@ public:
bool handleForwardBackwardMouseButtons(QMouseEvent *e);
+ QUrl source() const;
void setSource(const QUrl &url);
- inline QUrl source() const { return url(); }
inline QString documentTitle() const
{ return title(); }
@@ -109,6 +109,7 @@ protected:
private Q_SLOTS:
void actionChanged();
+ void setLoadStarted();
void setLoadFinished(bool ok);
private:
diff --git a/tools/shared/symbian/epocroot.cpp b/tools/shared/symbian/epocroot.cpp
index 064e056..ae1dcb1 100644
--- a/tools/shared/symbian/epocroot.cpp
+++ b/tools/shared/symbian/epocroot.cpp
@@ -105,10 +105,6 @@ static void fixEpocRoot(QString &path)
{
path.replace("\\", "/");
- if (path.size() > 1 && path[1] == QChar(':')) {
- path = path.mid(2);
- }
-
if (!path.size() || path[path.size()-1] != QChar('/')) {
path += QChar('/');
}