From c030349fe0d5f5a8bd9bfe7461f29704dbcfbfe4 Mon Sep 17 00:00:00 2001 From: Martin Kleusberg Date: Thu, 10 Aug 2017 21:33:33 +0200 Subject: [PATCH] Fix tests --- src/sqlitetablemodel.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/sqlitetablemodel.cpp b/src/sqlitetablemodel.cpp index ce802fa3..30ce27f2 100644 --- a/src/sqlitetablemodel.cpp +++ b/src/sqlitetablemodel.cpp @@ -656,6 +656,12 @@ void SqliteTableModel::removeCommentsFromQuery(QString& query) { query = result.trimmed(); } + + // Remove multiple line breaks that might have been created by deleting comments till the end of the line but not including the line break + query.replace(QRegExp("\\n+"), "\n"); + + // Also remove any remaining whitespace at the end of each line + query.replace(QRegExp("[ \t]+\n"), "\n"); } QStringList SqliteTableModel::getColumns(const QString& sQuery, QVector& fieldsTypes)