From f1a3a12c1cb5de40dab04799e5a2330f690a54d8 Mon Sep 17 00:00:00 2001 From: Jonas Kvinge Date: Fri, 7 Apr 2023 20:54:15 +0200 Subject: [PATCH] CollectionBackend: Fix SQL query error message --- src/collection/collectionbackend.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/collection/collectionbackend.cpp b/src/collection/collectionbackend.cpp index de9e2001e..3c43ee032 100644 --- a/src/collection/collectionbackend.cpp +++ b/src/collection/collectionbackend.cpp @@ -105,13 +105,11 @@ void CollectionBackend::ReportErrors(const CollectionQuery &query) { const QSqlError sql_error = query.lastError(); if (sql_error.isValid()) { - qLog(Error) << "Unable to execute collection SQL query: " << sql_error; - qLog(Error) << "Faulty SQL query: " << query.lastQuery(); - qLog(Error) << "Bound SQL values: " << query.boundValues(); - QString error; - error += "Unable to execute collection SQL query: " + sql_error.text() + "
"; - error += "Faulty SQL query: " + query.lastQuery(); - emit Error(error); + qLog(Error) << "Unable to execute collection SQL query:" << sql_error; + qLog(Error) << "Failed SQL query:" << query.lastQuery(); + qLog(Error) << "Bound SQL values:" << query.boundValues(); + emit Error(tr("Unable to execute collection SQL query: %1").arg(sql_error.text())); + emit Error(tr("Failed SQL query: %1").arg(query.lastQuery())); } }