summaryrefslogtreecommitdiffstats
path: root/tools/assistant
diff options
context:
space:
mode:
authorThomas Zander <t.zander@nokia.com>2010-10-06 12:32:43 (GMT)
committerThomas Zander <t.zander@nokia.com>2010-10-06 12:32:43 (GMT)
commite3724aeab93a2ab3cc5b1d78c42f9a4e2f60628d (patch)
tree08fa39a9605ec38a45247baea0e2053179f5970f /tools/assistant
parent838ed9c68aef4d5a4f0b4d4dbbc1c1f7797cde91 (diff)
parent901ea45ca02dc8fbbf3f6112240c4e468c240b73 (diff)
downloadQt-e3724aeab93a2ab3cc5b1d78c42f9a4e2f60628d.zip
Qt-e3724aeab93a2ab3cc5b1d78c42f9a4e2f60628d.tar.gz
Qt-e3724aeab93a2ab3cc5b1d78c42f9a4e2f60628d.tar.bz2
Merge commit 'origin/master' into fileEngines
Conflicts: src/s60installs/bwins/QtCoreu.def
Diffstat (limited to 'tools/assistant')
-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
-rw-r--r--tools/assistant/tools/qcollectiongenerator/main.cpp2
-rw-r--r--tools/assistant/tools/qhelpgenerator/main.cpp2
7 files changed, 27 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 537f867..48469d4 100644
--- a/tools/assistant/tools/assistant/mainwindow.cpp
+++ b/tools/assistant/tools/assistant/mainwindow.cpp
@@ -119,7 +119,7 @@ MainWindow::MainWindow(CmdLineParser *cmdLine, QWidget *parent)
HelpEngineWrapper::instance(collectionFile);
BookmarkManager *bookMarkManager = BookmarkManager::instance();
- if (!initHelpDB()) {
+ if (!initHelpDB(!cmdLine->collectionFileGiven())) {
qDebug("Fatal error: Help engine initialization failed. "
"Error message was: %s\nAssistant will now exit.",
qPrintable(HelpEngineWrapper::instance().error()));
@@ -313,13 +313,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 ea4ebd6..9b4dbce 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);
diff --git a/tools/assistant/tools/qcollectiongenerator/main.cpp b/tools/assistant/tools/qcollectiongenerator/main.cpp
index 1046e56..7abbad1 100644
--- a/tools/assistant/tools/qcollectiongenerator/main.cpp
+++ b/tools/assistant/tools/qcollectiongenerator/main.cpp
@@ -363,6 +363,7 @@ int main(int argc, char *argv[])
bool showVersion = false;
QCoreApplication app(argc, argv);
+#ifndef Q_OS_WIN32
QTranslator translator;
QTranslator qtTranslator;
QTranslator qt_helpTranslator;
@@ -375,6 +376,7 @@ int main(int argc, char *argv[])
app.installTranslator(&qtTranslator);
app.installTranslator(&qt_helpTranslator);
}
+#endif // Q_OS_WIN32
for (int i=1; i<argc; ++i) {
arg = QString::fromLocal8Bit(argv[i]);
diff --git a/tools/assistant/tools/qhelpgenerator/main.cpp b/tools/assistant/tools/qhelpgenerator/main.cpp
index 637786c..5e20b4e 100644
--- a/tools/assistant/tools/qhelpgenerator/main.cpp
+++ b/tools/assistant/tools/qhelpgenerator/main.cpp
@@ -68,6 +68,7 @@ int main(int argc, char *argv[])
bool checkLinks = false;
QCoreApplication app(argc, argv);
+#ifndef Q_OS_WIN32
QTranslator translator;
QTranslator qtTranslator;
QTranslator qt_helpTranslator;
@@ -80,6 +81,7 @@ int main(int argc, char *argv[])
app.installTranslator(&qtTranslator);
app.installTranslator(&qt_helpTranslator);
}
+#endif // Q_OS_WIN32
for (int i = 1; i < argc; ++i) {
arg = QString::fromLocal8Bit(argv[i]);