diff options
author | Christian Kandeler <christian.kandeler@nokia.com> | 2010-09-23 15:33:22 (GMT) |
---|---|---|
committer | Christian Kandeler <christian.kandeler@nokia.com> | 2010-09-23 15:36:47 (GMT) |
commit | 06cda1a17c9cfe50256a949e72882892151c94b6 (patch) | |
tree | ab0d51834338f9ead0bfe7621d800e7ab9e8b92b /tools/assistant | |
parent | e14f5aca56d652137a79fe9ae85b4d034a09e018 (diff) | |
download | Qt-06cda1a17c9cfe50256a949e72882892151c94b6.zip Qt-06cda1a17c9cfe50256a949e72882892151c94b6.tar.gz Qt-06cda1a17c9cfe50256a949e72882892151c94b6.tar.bz2 |
Assistant: Don't register internal doc when using custom collection.
This is intended to keep the internal documentation out of the
"custom help viewer" use case, where it does not belong.
Reviewed-by: kh1
Diffstat (limited to 'tools/assistant')
-rw-r--r-- | tools/assistant/tools/assistant/cmdlineparser.cpp | 7 | ||||
-rw-r--r-- | tools/assistant/tools/assistant/cmdlineparser.h | 1 | ||||
-rw-r--r-- | tools/assistant/tools/assistant/mainwindow.cpp | 9 | ||||
-rw-r--r-- | tools/assistant/tools/assistant/mainwindow.h | 2 |
4 files changed, 16 insertions, 3 deletions
diff --git a/tools/assistant/tools/assistant/cmdlineparser.cpp b/tools/assistant/tools/assistant/cmdlineparser.cpp index 1cf2915..181abe2 100644 --- a/tools/assistant/tools/assistant/cmdlineparser.cpp +++ b/tools/assistant/tools/assistant/cmdlineparser.cpp @@ -300,6 +300,13 @@ QString CmdLineParser::collectionFile() const return m_collectionFile; } +bool CmdLineParser::collectionFileGiven() const +{ + TRACE_OBJ + return m_arguments.contains(QLatin1String("-collectionfile"), + Qt::CaseInsensitive); +} + QUrl CmdLineParser::url() const { TRACE_OBJ diff --git a/tools/assistant/tools/assistant/cmdlineparser.h b/tools/assistant/tools/assistant/cmdlineparser.h index db66494..9fc36b3 100644 --- a/tools/assistant/tools/assistant/cmdlineparser.h +++ b/tools/assistant/tools/assistant/cmdlineparser.h @@ -61,6 +61,7 @@ public: void setCollectionFile(const QString &file); QString collectionFile() const; + bool collectionFileGiven() const; QString cloneFile() const; QUrl url() const; bool enableRemoteControl() const; diff --git a/tools/assistant/tools/assistant/mainwindow.cpp b/tools/assistant/tools/assistant/mainwindow.cpp index 65a58c0..68343a4 100644 --- a/tools/assistant/tools/assistant/mainwindow.cpp +++ b/tools/assistant/tools/assistant/mainwindow.cpp @@ -161,7 +161,7 @@ MainWindow::MainWindow(CmdLineParser *cmdLine, QWidget *parent) setupActions(); statusBar()->show(); - if (initHelpDB()) { + if (initHelpDB(!cmdLine->collectionFileGiven())) { setupFilterToolbar(); setupAddressToolbar(); @@ -281,13 +281,18 @@ void MainWindow::closeEvent(QCloseEvent *e) QMainWindow::closeEvent(e); } -bool MainWindow::initHelpDB() +bool MainWindow::initHelpDB(bool registerInternalDoc) { TRACE_OBJ HelpEngineWrapper &helpEngineWrapper = HelpEngineWrapper::instance(); if (!helpEngineWrapper.setupData()) return false; + if (!registerInternalDoc) { + if (helpEngineWrapper.defaultHomePage() == QLatin1String("help")) + helpEngineWrapper.setDefaultHomePage(QLatin1String("about:blank")); + return true; + } bool assistantInternalDocRegistered = false; QString intern(QLatin1String("com.trolltech.com.assistantinternal-")); foreach (const QString &ns, helpEngineWrapper.registeredDocumentations()) { diff --git a/tools/assistant/tools/assistant/mainwindow.h b/tools/assistant/tools/assistant/mainwindow.h index 8219140..26726ee 100644 --- a/tools/assistant/tools/assistant/mainwindow.h +++ b/tools/assistant/tools/assistant/mainwindow.h @@ -121,7 +121,7 @@ private slots: void documentationUpdated(const QString &namespaceName); private: - bool initHelpDB(); + bool initHelpDB(bool registerInternalDoc); void setupActions(); void closeEvent(QCloseEvent *e); void activateDockWidget(QWidget *w); |