Merge branch 'upstream' into 'upstream'
Upstream See merge request kylinos-src/kylin-connectivity!46
This commit is contained in:
commit
494bc626e7
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue