Make sure .qch file is opened read-only
authorKai Koehne <kai.koehne@digia.com>
Wed, 13 Nov 2013 15:33:51 +0000 (16:33 +0100)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Thu, 14 Nov 2013 13:22:26 +0000 (14:22 +0100)
So far qsqlite tried to open the file first read/write, and falling back
to read access only if this fails. This has resulted in excessively long
loading times e.g. on Windows XP.

Task-number: QTCREATORBUG-10697
Change-Id: I7b1dbddb73feb34491ece5a0765a67354b937f43
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Karsten Heimrich <karsten.heimrich@digia.com>
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
src/assistant/help/qhelpdbreader.cpp

index 4157105..6262dfe 100644 (file)
@@ -90,6 +90,7 @@ bool QHelpDBReader::init()
         return false;
 
     QSqlDatabase db = QSqlDatabase::addDatabase(QLatin1String("QSQLITE"), m_uniqueId);
+    db.setConnectOptions(QLatin1String("QSQLITE_OPEN_READONLY"));
     db.setDatabaseName(m_dbName);
     if (!db.open()) {
         /*: The placeholders are: %1 - The name of the database which cannot be opened