From e314545f2e377a73f1718b713efa9860b183385d Mon Sep 17 00:00:00 2001 From: Jonas Kvinge Date: Fri, 7 Apr 2023 20:54:31 +0200 Subject: [PATCH] Database: Fix SQL query error message --- src/core/database.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/core/database.cpp b/src/core/database.cpp index 24a5d526b..ae753eecf 100644 --- a/src/core/database.cpp +++ b/src/core/database.cpp @@ -472,12 +472,10 @@ void Database::ReportErrors(const SqlQuery &query) { const QSqlError sql_error = query.lastError(); if (sql_error.isValid()) { - qLog(Error) << "Unable to execute SQL query: " << sql_error; - qLog(Error) << "Failed query: " << query.LastQuery(); - QString error; - error += "Unable to execute SQL query: " + sql_error.text() + "
"; - error += "Failed query: " + query.LastQuery(); - emit Error(error); + qLog(Error) << "Unable to execute SQL query:" << sql_error; + qLog(Error) << "Failed SQL query:" << query.LastQuery(); + emit Error(tr("Unable to execute SQL query: %1").arg(sql_error.text())); + emit Error(tr("Failed SQL query: %1").arg(query.LastQuery())); } }