Fix for auto qstringbuilder deduction

This commit is contained in:
Martin Rotter 2021-03-17 12:07:38 +01:00
parent 57a67760c4
commit 95892001f6

View File

@ -16,13 +16,13 @@ QStringList DatabaseDriver::prepareScript(const QString& base_sql_folder,
const QString& sql_file, const QString& sql_file,
const QString& database_name) { const QString& database_name) {
QStringList statements; QStringList statements;
auto next_file = base_sql_folder + QDir::separator() + sql_file; QString next_file = base_sql_folder + QDir::separator() + sql_file;
QString sql_script = QString::fromUtf8(IOFactory::readFile(next_file)); QString sql_script = QString::fromUtf8(IOFactory::readFile(next_file));
auto new_statements = sql_script.split(APP_DB_COMMENT_SPLIT, QStringList new_statements = sql_script.split(APP_DB_COMMENT_SPLIT,
#if QT_VERSION >= 0x050F00 // Qt >= 5.15.0 #if QT_VERSION >= 0x050F00 // Qt >= 5.15.0
Qt::SplitBehaviorFlags::SkipEmptyParts); Qt::SplitBehaviorFlags::SkipEmptyParts);
#else #else
QString::SplitBehavior::SkipEmptyParts); QString::SplitBehavior::SkipEmptyParts);
#endif #endif
for (int i = 0; i < new_statements.size(); i++) { for (int i = 0; i < new_statements.size(); i++) {
@ -30,13 +30,13 @@ QStringList DatabaseDriver::prepareScript(const QString& base_sql_folder,
// We include another file. // We include another file.
QString included_file_name = new_statements.at(i).mid(QSL(APP_DB_INCLUDE_PLACEHOLDER).size() + 1); QString included_file_name = new_statements.at(i).mid(QSL(APP_DB_INCLUDE_PLACEHOLDER).size() + 1);
auto included_file = base_sql_folder + QDir::separator() + included_file_name; QString included_file = base_sql_folder + QDir::separator() + included_file_name;
QString included_sql_script = QString::fromUtf8(IOFactory::readFile(included_file)); QString included_sql_script = QString::fromUtf8(IOFactory::readFile(included_file));
auto included_statements = included_sql_script.split(APP_DB_COMMENT_SPLIT, QStringList included_statements = included_sql_script.split(APP_DB_COMMENT_SPLIT,
#if QT_VERSION >= 0x050F00 // Qt >= 5.15.0 #if QT_VERSION >= 0x050F00 // Qt >= 5.15.0
Qt::SplitBehaviorFlags::SkipEmptyParts); Qt::SplitBehaviorFlags::SkipEmptyParts);
#else #else
QString::SplitBehavior::SkipEmptyParts); QString::SplitBehavior::SkipEmptyParts);
#endif #endif
statements << included_statements; statements << included_statements;