Merge branch 'upstream' into 'upstream'

Upstream

See merge request kylinos-src/kylin-connectivity!46
This commit is contained in:
赵杨 2022-10-20 02:12:13 +00:00
commit 494bc626e7
1 changed files with 6 additions and 0 deletions

View File

@ -1,6 +1,7 @@
#include "filedatabase.h"
#include <QDebug>
#include <QDir>
#include <QtSql/QSqlQuery>
#include <QtSql/QSqlDriver>
#include <QtSql/QSqlError>
@ -22,6 +23,11 @@ enum HEADER_NAME {
FileDataBase::FileDataBase(QObject *parent) : QObject(parent)
{
QMutexLocker lockData(&m_mutex);
QDir downDir(DATABASE_PATH);
if (!downDir.exists(DATABASE_PATH)) {
// 文件夹不存在,创建文件夹
downDir.mkpath(DATABASE_PATH);
}
if (QSqlDatabase::contains(DATABASE_NAME)) {
// 本地已存在该数据库
m_DataBase = QSqlDatabase::database(DATABASE_NAME);