Skip to content

Commit b4f3055

Browse files
committedOct 7, 2017
[spatialite] Avoid the term "Error", saving style to DB is optional
1 parent 8915936 commit b4f3055

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed
 

‎src/providers/spatialite/qgsspatialiteprovider.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5711,15 +5711,15 @@ QGISEXTERN QString loadStyle( const QString &uri, QString &errCause )
57115711
{
57125712
QgsDataSourceUri dsUri( uri );
57135713
QString sqlitePath = dsUri.database();
5714-
QgsDebugMsg( "Database is: " + sqlitePath );
5714+
QgsDebugMsgLevel( "Database is: " + sqlitePath, 5 );
57155715

57165716
// trying to open the SQLite DB
57175717
QgsSqliteHandle *handle = QgsSqliteHandle::openDb( sqlitePath );
57185718
if ( !handle )
57195719
{
57205720
QgsDebugMsg( "Connection to database failed. Save style aborted." );
57215721
errCause = QObject::tr( "Connection to database failed" );
5722-
return QLatin1String( "" );
5722+
return QString();
57235723
}
57245724

57255725
sqlite3 *sqliteHandle = handle->handle();
@@ -5743,9 +5743,9 @@ QGISEXTERN QString loadStyle( const QString &uri, QString &errCause )
57435743
if ( SQLITE_OK != ret )
57445744
{
57455745
QgsSqliteHandle::closeDb( handle );
5746-
QgsMessageLog::logMessage( QObject::tr( "Error executing query: %1" ).arg( selectQmlQuery ) );
5746+
QgsMessageLog::logMessage( QObject::tr( "Could not load styles from %1 (Query: %2)" ).arg( sqlitePath, selectQmlQuery ) );
57475747
errCause = QObject::tr( "Error executing loading style. The query was logged" );
5748-
return QLatin1String( "" );
5748+
return QString();
57495749
}
57505750

57515751
QString style = ( rows == 1 ) ? QString::fromUtf8( results[( rows * columns ) + 0 ] ) : QLatin1String( "" );
@@ -5894,7 +5894,7 @@ QGISEXTERN QString getStyleById( const QString &uri, QString styleId, QString &e
58945894
}
58955895
else
58965896
{
5897-
QgsMessageLog::logMessage( QObject::tr( "Error executing query: %1" ).arg( selectQmlQuery ) );
5897+
QgsMessageLog::logMessage( QObject::tr( "Style with id %1 not found in %2 (Query: %3)" ).arg( styleId, sqlitePath, selectQmlQuery ) );
58985898
errCause = QObject::tr( "Error executing the select query. The query was logged" );
58995899
}
59005900

0 commit comments

Comments
 (0)
Please sign in to comment.