summaryrefslogtreecommitdiffstats
path: root/tools/assistant
diff options
context:
space:
mode:
authorDavid Boddie <dboddie@trolltech.com>2010-06-21 17:02:54 (GMT)
committerDavid Boddie <dboddie@trolltech.com>2010-06-21 17:02:54 (GMT)
commit84ce7cc25b925d493a048ce5b00290483cd974f4 (patch)
tree0f4e709ca90e9bf3e683668460734282f426089d /tools/assistant
parenta2a5a8c5e203fe9d55f9addba1533a30c6f2ba19 (diff)
parent32e532743dc6243612ade017e8c326ca0e7e0dec (diff)
downloadQt-84ce7cc25b925d493a048ce5b00290483cd974f4.zip
Qt-84ce7cc25b925d493a048ce5b00290483cd974f4.tar.gz
Qt-84ce7cc25b925d493a048ce5b00290483cd974f4.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.7
Diffstat (limited to 'tools/assistant')
-rw-r--r--tools/assistant/lib/fulltextsearch/fulltextsearch.pro2
-rw-r--r--tools/assistant/tools/assistant/helpviewer_qwv.cpp23
-rw-r--r--tools/assistant/tools/assistant/helpviewer_qwv.h3
3 files changed, 25 insertions, 3 deletions
diff --git a/tools/assistant/lib/fulltextsearch/fulltextsearch.pro b/tools/assistant/lib/fulltextsearch/fulltextsearch.pro
index fb1a0dd..4d2fddb 100644
--- a/tools/assistant/lib/fulltextsearch/fulltextsearch.pro
+++ b/tools/assistant/lib/fulltextsearch/fulltextsearch.pro
@@ -29,7 +29,7 @@ unix:QMAKE_PKGCONFIG_REQUIRES = QtCore
CONFIG(exceptions_off) {
CONFIG -= exceptions_off
CONFIG += exceptions
- !win32|win32-g++ {
+ !win32|win32-g++* {
QMAKE_CFLAGS -= -fno-exceptions
QMAKE_CXXFLAGS -= -fno-exceptions
QMAKE_LFLAGS -= -fno-exceptions
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: