1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-13 10:32:11 +01:00

Show error message when QSQLITE plugin is not available

This commit is contained in:
David Rosca 2014-10-05 16:12:29 +02:00
parent 6d06975ccb
commit aac873bbb6

View File

@ -32,7 +32,6 @@
#include "rssmanager.h" #include "rssmanager.h"
#include "proxystyle.h" #include "proxystyle.h"
#include "pluginproxy.h" #include "pluginproxy.h"
#include "sqldatabase.h"
#include "iconprovider.h" #include "iconprovider.h"
#include "browserwindow.h" #include "browserwindow.h"
#include "networkmanager.h" #include "networkmanager.h"
@ -55,6 +54,7 @@
#include <QFontDatabase> #include <QFontDatabase>
#include <QSqlDatabase> #include <QSqlDatabase>
#include <QLibraryInfo> #include <QLibraryInfo>
#include <QMessageBox>
#include <QTranslator> #include <QTranslator>
#include <QThreadPool> #include <QThreadPool>
#include <QSettings> #include <QSettings>
@ -111,6 +111,14 @@ MainApplication::MainApplication(int &argc, char** argv)
QIcon::setThemeName(QSL("oxygen-fallback")); QIcon::setThemeName(QSL("oxygen-fallback"));
} }
// QSQLITE database plugin is required
if (!QSqlDatabase::isDriverAvailable(QSL("QSQLITE"))) {
QMessageBox::critical(0, QSL("Error"), QSL("Qt SQLite database plugin is not available. "
"Please install it and restart the application."));
m_isClosing = true;
return;
}
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
// Set default app font (needed for N'ko) // Set default app font (needed for N'ko)
int fontId = QFontDatabase::addApplicationFont(QSL("font.ttf")); int fontId = QFontDatabase::addApplicationFont(QSL("font.ttf"));