summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2009-04-23 13:47:30 (GMT)
committerThiago Macieira <thiago.macieira@nokia.com>2009-04-23 13:47:30 (GMT)
commitff4864e079accef109a8a45e9754f7ac34718ec5 (patch)
tree004c0e6dc99187fa6e2dd35b898c4b41ce30d06e /tools
parent63414acd04910b6b016786f1c340440562eebca1 (diff)
parent2e8ece735d6a31f4657192e77b9dc53fb2a03e9c (diff)
downloadQt-ff4864e079accef109a8a45e9754f7ac34718ec5.zip
Qt-ff4864e079accef109a8a45e9754f7ac34718ec5.tar.gz
Qt-ff4864e079accef109a8a45e9754f7ac34718ec5.tar.bz2
Merge branch '4.5'
Conflicts: tests/auto/qaction/tst_qaction.cpp
Diffstat (limited to 'tools')
-rw-r--r--tools/assistant/tools/assistant/centralwidget.cpp4
-rw-r--r--tools/assistant/tools/assistant/helpviewer.cpp12
-rw-r--r--tools/assistant/tools/assistant/helpviewer.h4
-rw-r--r--tools/assistant/tools/assistant/indexwindow.cpp2
-rw-r--r--tools/assistant/tools/assistant/mainwindow.cpp60
-rw-r--r--tools/qdoc3/qdoc3.pro7
6 files changed, 57 insertions, 32 deletions
diff --git a/tools/assistant/tools/assistant/centralwidget.cpp b/tools/assistant/tools/assistant/centralwidget.cpp
index 1b0e671..633747a 100644
--- a/tools/assistant/tools/assistant/centralwidget.cpp
+++ b/tools/assistant/tools/assistant/centralwidget.cpp
@@ -277,7 +277,11 @@ CentralWidget *CentralWidget::instance()
void CentralWidget::newTab()
{
HelpViewer* viewer = currentHelpViewer();
+#if !defined(QT_NO_WEBKIT)
+ if (viewer && viewer->hasLoadFinished())
+#else
if (viewer)
+#endif
setSourceInNewTab(viewer->source());
}
diff --git a/tools/assistant/tools/assistant/helpviewer.cpp b/tools/assistant/tools/assistant/helpviewer.cpp
index f7225fa..5ce6e14 100644
--- a/tools/assistant/tools/assistant/helpviewer.cpp
+++ b/tools/assistant/tools/assistant/helpviewer.cpp
@@ -269,7 +269,10 @@ bool HelpPage::acceptNavigationRequest(QWebFrame *,
}
HelpViewer::HelpViewer(QHelpEngine *engine, CentralWidget *parent)
- : QWebView(parent), helpEngine(engine), parentWidget(parent)
+ : QWebView(parent)
+ , helpEngine(engine)
+ , parentWidget(parent)
+ , loadFinished(false)
{
setAcceptDrops(false);
@@ -295,10 +298,12 @@ HelpViewer::HelpViewer(QHelpEngine *engine, CentralWidget *parent)
connect(page(), SIGNAL(linkHovered(QString, QString, QString)), this,
SIGNAL(highlighted(QString)));
connect(this, SIGNAL(urlChanged(QUrl)), this, SIGNAL(sourceChanged(QUrl)));
+ connect(this, SIGNAL(loadFinished(bool)), this, SLOT(setLoadFinished(bool)));
}
void HelpViewer::setSource(const QUrl &url)
{
+ loadFinished = false;
if (url.toString() == QLatin1String("help")) {
load(QUrl(QLatin1String("qthelp://com.trolltech.com."
"assistantinternal_1.0.0/assistant/assistant.html")));
@@ -385,6 +390,11 @@ void HelpViewer::mousePressEvent(QMouseEvent *event)
QWebView::mousePressEvent(event);
}
+void HelpViewer::setLoadFinished(bool ok)
+{
+ loadFinished = ok;
+}
+
#else // !defined(QT_NO_WEBKIT)
HelpViewer::HelpViewer(QHelpEngine *engine, CentralWidget *parent)
diff --git a/tools/assistant/tools/assistant/helpviewer.h b/tools/assistant/tools/assistant/helpviewer.h
index eea7340..c66b69c 100644
--- a/tools/assistant/tools/assistant/helpviewer.h
+++ b/tools/assistant/tools/assistant/helpviewer.h
@@ -92,6 +92,8 @@ public:
{ return pageAction(QWebPage::Forward)->isEnabled(); }
inline bool isBackwardAvailable() const
{ return pageAction(QWebPage::Back)->isEnabled(); }
+ inline bool hasLoadFinished() const
+ { return loadFinished; }
public Q_SLOTS:
void home();
@@ -111,10 +113,12 @@ protected:
private Q_SLOTS:
void actionChanged();
+ void setLoadFinished(bool ok);
private:
QHelpEngine *helpEngine;
CentralWidget* parentWidget;
+ bool loadFinished;
};
#else
diff --git a/tools/assistant/tools/assistant/indexwindow.cpp b/tools/assistant/tools/assistant/indexwindow.cpp
index 0beb5ee..a2c0950 100644
--- a/tools/assistant/tools/assistant/indexwindow.cpp
+++ b/tools/assistant/tools/assistant/indexwindow.cpp
@@ -197,6 +197,8 @@ void IndexWindow::open(QHelpIndexWidget* indexWidget, const QModelIndex &index)
url = tc.link();
} else if (links.count() == 1) {
url = links.constBegin().value();
+ } else {
+ return;
}
if (url.path().endsWith(QLatin1String(".pdf"), Qt::CaseInsensitive))
diff --git a/tools/assistant/tools/assistant/mainwindow.cpp b/tools/assistant/tools/assistant/mainwindow.cpp
index bcafacc..c1e9027 100644
--- a/tools/assistant/tools/assistant/mainwindow.cpp
+++ b/tools/assistant/tools/assistant/mainwindow.cpp
@@ -134,10 +134,10 @@ MainWindow::MainWindow(CmdLineParser *cmdLine, QWidget *parent)
dock->setWidget(m_searchWidget);
addDockWidget(Qt::LeftDockWidgetArea, dock);
- connect(m_searchWidget, SIGNAL(requestShowLink(const QUrl&)),
- m_centralWidget, SLOT(setSource(const QUrl&)));
- connect(m_searchWidget, SIGNAL(requestShowLinkInNewTab(const QUrl&)),
- m_centralWidget, SLOT(setSourceInNewTab(const QUrl&)));
+ connect(m_searchWidget, SIGNAL(requestShowLink(QUrl)), m_centralWidget,
+ SLOT(setSource(QUrl)));
+ connect(m_searchWidget, SIGNAL(requestShowLinkInNewTab(QUrl)),
+ m_centralWidget, SLOT(setSourceInNewTab(QUrl)));
#endif
QString defWindowTitle = tr("Qt Assistant");
@@ -228,6 +228,18 @@ MainWindow::MainWindow(CmdLineParser *cmdLine, QWidget *parent)
else if (m_cmdLine->bookmarks() == CmdLineParser::Activate)
showBookmarks();
+ if (!m_cmdLine->currentFilter().isEmpty()) {
+ const QString &curFilter = m_cmdLine->currentFilter();
+ m_helpEngine->setCurrentFilter(curFilter);
+ int idx = m_filterCombo->findText(curFilter);
+ if (idx >= 0) {
+ bool blocked = m_filterCombo->signalsBlocked();
+ m_filterCombo->blockSignals(true);
+ m_filterCombo->setCurrentIndex(idx);
+ m_filterCombo->blockSignals(blocked);
+ }
+ }
+
if (usesDefaultCollection())
QTimer::singleShot(0, this, SLOT(lookForNewQtDocumentation()));
else
@@ -304,6 +316,7 @@ bool MainWindow::initHelpDB()
hc.addCustomFilter(tr("Unfiltered"), QStringList());
hc.setCustomValue(unfiltered, 1);
}
+
m_helpEngine->blockSignals(true);
m_helpEngine->setCurrentFilter(tr("Unfiltered"));
m_helpEngine->blockSignals(false);
@@ -318,10 +331,10 @@ bool MainWindow::initHelpDB()
void MainWindow::lookForNewQtDocumentation()
{
m_qtDocInstaller = new QtDocInstaller(m_helpEngine->collectionFile());
- connect(m_qtDocInstaller, SIGNAL(errorMessage(const QString&)),
- this, SLOT(displayInstallationError(const QString&)));
- connect(m_qtDocInstaller, SIGNAL(docsInstalled(bool)),
- this, SLOT(qtDocumentationInstalled(bool)));
+ connect(m_qtDocInstaller, SIGNAL(errorMessage(QString)), this,
+ SLOT(displayInstallationError(QString)));
+ connect(m_qtDocInstaller, SIGNAL(docsInstalled(bool)), this,
+ SLOT(qtDocumentationInstalled(bool)));
QString versionKey = QString(QLatin1String("qtVersion%1$$$qt")).
arg(QLatin1String(QT_VERSION_STR));
@@ -353,8 +366,8 @@ void MainWindow::checkInitState()
if (!m_connectedInitSignals) {
connect(m_helpEngine->contentModel(), SIGNAL(contentsCreated()),
this, SLOT(checkInitState()));
- connect(m_helpEngine->indexModel(), SIGNAL(indexCreated()),
- this, SLOT(checkInitState()));
+ connect(m_helpEngine->indexModel(), SIGNAL(indexCreated()), this,
+ SLOT(checkInitState()));
m_connectedInitSignals = true;
}
} else {
@@ -601,8 +614,8 @@ void MainWindow::setupFilterToolbar()
connect(m_helpEngine, SIGNAL(setupFinished()), this,
SLOT(setupFilterCombo()));
- connect(m_filterCombo, SIGNAL(activated(const QString&)), this,
- SLOT(filterDocumentation(const QString&)));
+ connect(m_filterCombo, SIGNAL(activated(QString)), this,
+ SLOT(filterDocumentation(QString)));
setupFilterCombo();
}
@@ -626,12 +639,12 @@ void MainWindow::setupAddressToolbar()
toolBarMenu()->addAction(addressToolBar->toggleViewAction());
// address lineedit
- connect(m_addressLineEdit, SIGNAL(returnPressed()),
- this, SLOT(gotoAddress()));
- connect(m_centralWidget, SIGNAL(currentViewerChanged()),
- this, SLOT(showNewAddress()));
- connect(m_centralWidget, SIGNAL(sourceChanged(const QUrl&)),
- this, SLOT(showNewAddress(const QUrl&)));
+ connect(m_addressLineEdit, SIGNAL(returnPressed()), this,
+ SLOT(gotoAddress()));
+ connect(m_centralWidget, SIGNAL(currentViewerChanged()), this,
+ SLOT(showNewAddress()));
+ connect(m_centralWidget, SIGNAL(sourceChanged(QUrl)), this,
+ SLOT(showNewAddress(QUrl)));
}
void MainWindow::updateAboutMenuText()
@@ -712,10 +725,10 @@ void MainWindow::showPreferences()
{
PreferencesDialog dia(m_helpEngine, this);
- connect(&dia, SIGNAL(updateApplicationFont()),
- this, SLOT(updateApplicationFont()));
- connect(&dia, SIGNAL(updateBrowserFont()),
- m_centralWidget, SLOT(updateBrowserFont()));
+ connect(&dia, SIGNAL(updateApplicationFont()), this,
+ SLOT(updateApplicationFont()));
+ connect(&dia, SIGNAL(updateBrowserFont()), m_centralWidget,
+ SLOT(updateBrowserFont()));
dia.showDialog();
}
@@ -950,8 +963,7 @@ QWidget* MainWindow::setupBookmarkWidget()
{
m_bookmarkManager = new BookmarkManager(m_helpEngine);
m_bookmarkWidget = new BookmarkWidget(m_bookmarkManager, this);
- connect(m_bookmarkWidget, SIGNAL(addBookmark()),
- this, SLOT(addBookmark()));
+ connect(m_bookmarkWidget, SIGNAL(addBookmark()), this, SLOT(addBookmark()));
return m_bookmarkWidget;
}
diff --git a/tools/qdoc3/qdoc3.pro b/tools/qdoc3/qdoc3.pro
index 3268585..2bba8fb 100644
--- a/tools/qdoc3/qdoc3.pro
+++ b/tools/qdoc3/qdoc3.pro
@@ -99,10 +99,3 @@ SOURCES += apigenerator.cpp \
webxmlgenerator.cpp \
yyindent.cpp
-
-win32 {
- QT_WINCONFIG = release
- CONFIG(debug, debug|release) {
- QT_WINCONFIG = debug
- }
-}