diff options
author | ck <qt-info@nokia.com> | 2010-01-21 13:56:14 (GMT) |
---|---|---|
committer | ck <qt-info@nokia.com> | 2010-01-21 13:56:14 (GMT) |
commit | b739ad7a9f8a81d9f68be53045e3ab9e2ff48ff6 (patch) | |
tree | e75f5c1d084af396f0fd56d8c8c0ca091d17518e /tools/assistant | |
parent | 6b92cb8ec199159d629c013fbd4b4b7ab8ad60db (diff) | |
download | Qt-b739ad7a9f8a81d9f68be53045e3ab9e2ff48ff6.zip Qt-b739ad7a9f8a81d9f68be53045e3ab9e2ff48ff6.tar.gz Qt-b739ad7a9f8a81d9f68be53045e3ab9e2ff48ff6.tar.bz2 |
Assistant: Simplify check for SQLITE plugin.
Reviewed-by: kh1
Diffstat (limited to 'tools/assistant')
-rw-r--r-- | tools/assistant/tools/assistant/main.cpp | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/tools/assistant/tools/assistant/main.cpp b/tools/assistant/tools/assistant/main.cpp index a13bf2e..434a211 100644 --- a/tools/assistant/tools/assistant/main.cpp +++ b/tools/assistant/tools/assistant/main.cpp @@ -223,19 +223,6 @@ bool rebuildSearchIndex(QCoreApplication &app, const QString &collectionFile, return app.exec() == 0; } -bool checkForSqlite(CmdLineParser &cmd) -{ - TRACE_OBJ - QSqlDatabase db; - QStringList sqlDrivers(db.drivers()); - if (!sqlDrivers.contains(QLatin1String("QSQLITE"))) { - cmd.showMessage(QObject::tr("Cannot load sqlite database driver!"), - true); - return false; - } - return true; -} - bool useGui(int argc, char *argv[]) { TRACE_OBJ @@ -407,8 +394,11 @@ int main(int argc, char *argv[]) ? EXIT_SUCCESS : EXIT_FAILURE; } - if (!checkForSqlite(cmd)) + if (!QSqlDatabase::isDriverAvailable(QLatin1String("QSQLITE"))) { + cmd.showMessage(QObject::tr("Cannot load sqlite database driver!"), + true); return EXIT_FAILURE; + } if (!cmd.currentFilter().isEmpty()) { if (collectionFileGiven) |