mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-10 08:04:25 +02:00
* Try to work-around translated error messages. Loathing.
This commit is contained in:
@@ -23,6 +23,7 @@
|
|||||||
#include "utils/TomahawkUtils.h"
|
#include "utils/TomahawkUtils.h"
|
||||||
#include "utils/Logger.h"
|
#include "utils/Logger.h"
|
||||||
|
|
||||||
|
#include <QCoreApplication>
|
||||||
#include <QSqlError>
|
#include <QSqlError>
|
||||||
#include <QTime>
|
#include <QTime>
|
||||||
#include <QThread>
|
#include <QThread>
|
||||||
@@ -85,8 +86,8 @@ TomahawkSqlQuery::exec()
|
|||||||
unsigned int retries = 0;
|
unsigned int retries = 0;
|
||||||
while ( !QSqlQuery::exec() && ++retries < 10 )
|
while ( !QSqlQuery::exec() && ++retries < 10 )
|
||||||
{
|
{
|
||||||
if ( lastError().text().toLower().contains( "no query" ) ||
|
if ( lastError().text() == QCoreApplication::translate( "QSQLiteResult", "No query" ) ||
|
||||||
lastError().text().toLower().contains( "parameter count mismatch" ) )
|
lastError().text() == QCoreApplication::translate( "QSQLiteResult", "Parameter count mismatch" ) )
|
||||||
{
|
{
|
||||||
tDebug() << Q_FUNC_INFO << "Re-preparing query!";
|
tDebug() << Q_FUNC_INFO << "Re-preparing query!";
|
||||||
|
|
||||||
@@ -162,5 +163,5 @@ TomahawkSqlQuery::isBusyError( const QSqlError& error ) const
|
|||||||
{
|
{
|
||||||
const QString text = error.text().trimmed().toLower();
|
const QString text = error.text().trimmed().toLower();
|
||||||
|
|
||||||
return ( text.contains( "locked" ) || text.contains( "busy" ) );
|
return ( error.number() == 5 || error.number() == 6 || text.contains( "locked" ) || text.contains( "busy" ) );
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user