From 7b361004589d144776eaed704a5b31d93cc91616 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20=C3=81ngel=20San=20Mart=C3=ADn?= Date: Thu, 14 Jan 2021 08:51:08 +0100 Subject: [PATCH] Use QString::fromStdString Just to keep things consistent in the whole round trip conversion --- YACReaderLibrary/db/query_parser.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/YACReaderLibrary/db/query_parser.cpp b/YACReaderLibrary/db/query_parser.cpp index 38381e5c..36916b53 100644 --- a/YACReaderLibrary/db/query_parser.cpp +++ b/YACReaderLibrary/db/query_parser.cpp @@ -53,9 +53,9 @@ int QueryParser::TreeNode::bindValues(QSqlQuery &selectQuery, int bindPosition) if (t == "token") { std::string bind_string(":bindPosition" + std::to_string(++bindPosition)); if (isIn(fieldType(children[0].t), { FieldType::numeric, FieldType::boolean })) { - selectQuery.bindValue(bind_string.c_str(), std::stoi(children[1].t)); + selectQuery.bindValue(QString::fromStdString(bind_string), std::stoi(children[1].t)); } else { - selectQuery.bindValue(bind_string.c_str(), ("%%" + children[1].t + "%%").c_str()); + selectQuery.bindValue(QString::fromStdString(bind_string), QString::fromStdString("%%" + children[1].t + "%%")); } } else if (t == "not") { bindPosition = children[0].bindValues(selectQuery, bindPosition); @@ -159,7 +159,7 @@ std::string QueryParser::join(const QStringList &strings, const std::string &del QStringList QueryParser::split(const std::string &string, char delim) { - auto words = QString(string.c_str()).split(delim); + auto words = QString::fromStdString(string).split(delim); return words; }