mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-06 00:05:02 -05:00
Fix warnings and QT < 5.10 chopped
This commit is contained in:
parent
feaf00fc4c
commit
e4c687d8dc
@ -764,8 +764,13 @@ bool QgsPostgresRasterProvider::init()
|
||||
throw QgsPostgresRasterProviderException( tr( "Cannot get band count from value: '%1'" ).arg( result.PQgetvalue( 0, 2 ) ) );
|
||||
}
|
||||
|
||||
const QStringList pxTypes { result.PQgetvalue( 0, 3 ).chopped( 1 ).mid( 1 ).split( ',' ) };
|
||||
const QStringList noDataValues { result.PQgetvalue( 0, 4 ).chopped( 1 ).mid( 1 ).split( ',' ) };
|
||||
QString pxTypesArray { result.PQgetvalue( 0, 3 ) };
|
||||
pxTypesArray.chop( 1 );
|
||||
const QStringList pxTypes { pxTypesArray.mid( 1 ).split( ',' ) };
|
||||
|
||||
QString noDataValuesArray { result.PQgetvalue( 0, 4 ) };
|
||||
noDataValuesArray.chop( 1 );
|
||||
const QStringList noDataValues { noDataValuesArray.mid( 1 ).split( ',' ) };
|
||||
|
||||
if ( mBandCount != pxTypes.count( ) || mBandCount != noDataValues.count() )
|
||||
{
|
||||
|
@ -130,7 +130,7 @@ QVariantMap QgsPostgresRasterUtils::parseWkb( const QByteArray &wkb, int bandNo
|
||||
result[ QStringLiteral( "dataSize" ) ] = static_cast<unsigned int>( pxSize * result[ QStringLiteral( "width" ) ].toInt() * result[ QStringLiteral( "height" ) ].toInt() );
|
||||
};
|
||||
|
||||
if ( bandNo > nBands )
|
||||
if ( static_cast<unsigned int>( bandNo ) > nBands )
|
||||
{
|
||||
QgsMessageLog::logMessage( QStringLiteral( "Band number is not valid: %1 (nBands: %2" )
|
||||
.arg( bandNo ).arg( nBands ), QStringLiteral( "PostGIS" ), Qgis::Critical );
|
||||
|
Loading…
x
Reference in New Issue
Block a user