summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-09-24 05:55:46 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-09-24 05:55:46 (GMT)
commit5e91a0a3add3b100fcae58eca7f700db12a456b4 (patch)
tree08df59c771e9a45399d592be38f7fd0e94cf3db4 /tools
parent108648a15dd06f56dab4e7efc8ce22552300b8f8 (diff)
parent06cda1a17c9cfe50256a949e72882892151c94b6 (diff)
downloadQt-5e91a0a3add3b100fcae58eca7f700db12a456b4.zip
Qt-5e91a0a3add3b100fcae58eca7f700db12a456b4.tar.gz
Qt-5e91a0a3add3b100fcae58eca7f700db12a456b4.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1: Assistant: Don't register internal doc when using custom collection. Assistant: Move comment to the right place.
Diffstat (limited to 'tools')
-rw-r--r--tools/assistant/tools/assistant/cmdlineparser.cpp7
-rw-r--r--tools/assistant/tools/assistant/cmdlineparser.h1
-rw-r--r--tools/assistant/tools/assistant/main.cpp12
-rw-r--r--tools/assistant/tools/assistant/mainwindow.cpp9
-rw-r--r--tools/assistant/tools/assistant/mainwindow.h2
5 files changed, 23 insertions, 8 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/main.cpp b/tools/assistant/tools/assistant/main.cpp
index bb86bfe..e3eef34 100644
--- a/tools/assistant/tools/assistant/main.cpp
+++ b/tools/assistant/tools/assistant/main.cpp
@@ -420,16 +420,18 @@ int main(int argc, char *argv[])
cachedCollection.setCurrentFilter(cmd.currentFilter());
}
- /*
- * We need to be careful here: The main window has to be deleted before
- * the help engine wrapper, which has to be deleted before the
- * QApplication.
- */
if (collectionFileGiven)
cmd.setCollectionFile(cachedCollectionFile);
+
MainWindow *w = new MainWindow(&cmd);
w->show();
a.connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit()));
+
+ /*
+ * We need to be careful here: The main window has to be deleted before
+ * the help engine wrapper, which has to be deleted before the
+ * QApplication.
+ */
const int retval = a.exec();
delete w;
HelpEngineWrapper::removeInstance();
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);