summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2016-11-18 05:44:31 (GMT)
committerMontel Laurent <montel@kde.org>2016-11-18 05:44:31 (GMT)
commit8c449d6a07a5da76080da9222e09c222eeac40ad (patch)
tree066a5fefe2ac34c24b577e8be6b6c07b5c927330
parent067206792343932ffdb670561d5e9587c6163f25 (diff)
Use new inline method
-rw-r--r--webengineviewer/src/checkphishingurl/localdatabasemanager.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/webengineviewer/src/checkphishingurl/localdatabasemanager.cpp b/webengineviewer/src/checkphishingurl/localdatabasemanager.cpp
index 6ee9d9d..b75e8ac 100644
--- a/webengineviewer/src/checkphishingurl/localdatabasemanager.cpp
+++ b/webengineviewer/src/checkphishingurl/localdatabasemanager.cpp
@@ -39,6 +39,9 @@ inline QString tableName() {
inline QString localDataBasePath() {
return QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QStringLiteral("/phishingurl/");
}
+inline QString sqlFileName() {
+ return QStringLiteral("/malwaredb.sql");
+}
}
LocalDataBaseManager::LocalDataBaseManager(QObject *parent)
@@ -58,7 +61,7 @@ void LocalDataBaseManager::closeDataBaseAndDeleteIt()
{
if (mDataBaseOk) {
mDataBase.close();
- QFile f(localDataBasePath() + QStringLiteral("/malwaredb.sql"));
+ QFile f(localDataBasePath() + sqlFileName());
if (!f.remove()) {
qCWarning(WEBENGINEVIEWER_LOG) << "impossible to remove local database file";
}
@@ -147,7 +150,7 @@ QSqlError LocalDataBaseManager::initDb()
{
mDataBase = QSqlDatabase::addDatabase(QStringLiteral("QSQLITE"));
QDir().mkpath(localDataBasePath());
- mDataBase.setDatabaseName(localDataBasePath() + QStringLiteral("/malwaredb.sql"));
+ mDataBase.setDatabaseName(localDataBasePath() + sqlFileName());
if (!mDataBase.open()) {
return mDataBase.lastError();
}