Skip to content
Permalink
Browse files

QStringLiteral -> QLatin1String changes generated by scripts/qstringf…

…ixup.sh --all
  • Loading branch information
rouault authored and nyalldawson committed Oct 11, 2020
1 parent 1c06551 commit a76670e521923f6773c78cb4b3f4220649867503
Showing 347 changed files with 1,305 additions and 1,305 deletions.
@@ -21,13 +21,13 @@ Base class for all diagram types.
public:

%ConvertToSubClassCode
if ( sipCpp->diagramName() == QStringLiteral( "Pie" ) )
if ( sipCpp->diagramName() == QLatin1String( "Pie" ) )
sipType = sipType_QgsPieDiagram;
else if ( sipCpp->diagramName() == QStringLiteral( "Histogram" ) )
else if ( sipCpp->diagramName() == QLatin1String( "Histogram" ) )
sipType = sipType_QgsHistogramDiagram;
else if ( sipCpp->diagramName() == QStringLiteral( "Text" ) )
else if ( sipCpp->diagramName() == QLatin1String( "Text" ) )
sipType = sipType_QgsTextDiagram;
else if ( sipCpp->diagramName() == QStringLiteral( "Stacked" ) )
else if ( sipCpp->diagramName() == QLatin1String( "Stacked" ) )
sipType = sipType_QgsStackedBarDiagram;
else
sipType = NULL;
@@ -641,9 +641,9 @@ Evaluates and returns the diagram settings relating to a diagram for a specific
#include "qgsdiagramrenderer.h"
%End
%ConvertToSubClassCode
if ( sipCpp->rendererName() == QStringLiteral( "SingleCategory" ) )
if ( sipCpp->rendererName() == QLatin1String( "SingleCategory" ) )
sipType = sipType_QgsSingleCategoryDiagramRenderer;
else if ( sipCpp->rendererName() == QStringLiteral( "LinearlyInterpolated" ) )
else if ( sipCpp->rendererName() == QLatin1String( "LinearlyInterpolated" ) )
sipType = sipType_QgsLinearlyInterpolatedDiagramRenderer;
else
sipType = NULL;
@@ -55,25 +55,25 @@ class QgsFeatureRenderer

const QString type = sipCpp->type();

if ( type == QStringLiteral( "singleSymbol" ) )
if ( type == QLatin1String( "singleSymbol" ) )
sipType = sipType_QgsSingleSymbolRenderer;
else if ( type == QStringLiteral( "categorizedSymbol" ) )
else if ( type == QLatin1String( "categorizedSymbol" ) )
sipType = sipType_QgsCategorizedSymbolRenderer;
else if ( type == QStringLiteral( "graduatedSymbol" ) )
else if ( type == QLatin1String( "graduatedSymbol" ) )
sipType = sipType_QgsGraduatedSymbolRenderer;
else if ( type == QStringLiteral( "RuleRenderer" ) )
else if ( type == QLatin1String( "RuleRenderer" ) )
sipType = sipType_QgsRuleBasedRenderer;
else if ( type == QStringLiteral( "heatmapRenderer" ) )
else if ( type == QLatin1String( "heatmapRenderer" ) )
sipType = sipType_QgsHeatmapRenderer;
else if ( type == QStringLiteral( "invertedPolygonRenderer" ) )
else if ( type == QLatin1String( "invertedPolygonRenderer" ) )
sipType = sipType_QgsInvertedPolygonRenderer;
else if ( type == QStringLiteral( "pointCluster" ) )
else if ( type == QLatin1String( "pointCluster" ) )
sipType = sipType_QgsPointClusterRenderer;
else if ( type == QStringLiteral( "pointDisplacement" ) )
else if ( type == QLatin1String( "pointDisplacement" ) )
sipType = sipType_QgsPointDisplacementRenderer;
else if ( type == QStringLiteral( "25dRenderer" ) )
else if ( type == QLatin1String( "25dRenderer" ) )
sipType = sipType_Qgs25DRenderer;
else if ( type == QStringLiteral( "nullSymbol" ) )
else if ( type == QLatin1String( "nullSymbol" ) )
sipType = sipType_QgsNullSymbolRenderer;
else
sipType = 0;
@@ -26,7 +26,7 @@ Base class for labeling configuration classes for vector tile layers.

const QString type = sipCpp->type();

if ( type == QStringLiteral( "basic" ) )
if ( type == QLatin1String( "basic" ) )
sipType = sipType_QgsVectorTileBasicLabeling;
else
sipType = 0;
@@ -85,7 +85,7 @@ For rendering it is expected that client code calls:

const QString type = sipCpp->type();

if ( type == QStringLiteral( "basic" ) )
if ( type == QLatin1String( "basic" ) )
sipType = sipType_QgsVectorTileBasicRenderer;
else
sipType = 0;
@@ -237,11 +237,11 @@ QString Qgs3DUtils::cullingModeToString( Qgs3DTypes::CullingMode mode )

Qgs3DTypes::CullingMode Qgs3DUtils::cullingModeFromString( const QString &str )
{
if ( str == QStringLiteral( "front" ) )
if ( str == QLatin1String( "front" ) )
return Qgs3DTypes::Front;
else if ( str == QStringLiteral( "back" ) )
else if ( str == QLatin1String( "back" ) )
return Qgs3DTypes::Back;
else if ( str == QStringLiteral( "front-and-back" ) )
else if ( str == QLatin1String( "front-and-back" ) )
return Qgs3DTypes::FrontAndBack;
else
return Qgs3DTypes::NoCulling;
@@ -24,9 +24,9 @@ void QgsSkyboxSettings::readXml( const QDomElement &element, const QgsReadWriteC
{
const QgsPathResolver &pathResolver = context.pathResolver();
QString skyboxTypeStr = element.attribute( QStringLiteral( "skybox-type" ) );
if ( skyboxTypeStr == QStringLiteral( "Distinct Faces" ) )
if ( skyboxTypeStr == QLatin1String( "Distinct Faces" ) )
mSkyboxType = QgsSkyboxEntity::DistinctTexturesSkybox;
else if ( skyboxTypeStr == QStringLiteral( "Panoramic Texture" ) )
else if ( skyboxTypeStr == QLatin1String( "Panoramic Texture" ) )
mSkyboxType = QgsSkyboxEntity::PanoramicSkybox;
mPanoramicTexturePath = pathResolver.readPath( element.attribute( QStringLiteral( "panoramic-texture-path" ) ) );
mCubeMapFacesPaths.clear();
@@ -120,19 +120,19 @@ QgsPoint3DSymbol::Shape QgsPoint3DSymbol::shapeFromString( const QString &shape
{
if ( shape == QStringLiteral( "sphere" ) )
return Sphere;
else if ( shape == QStringLiteral( "cone" ) )
else if ( shape == QLatin1String( "cone" ) )
return Cone;
else if ( shape == QStringLiteral( "cube" ) )
else if ( shape == QLatin1String( "cube" ) )
return Cube;
else if ( shape == QStringLiteral( "torus" ) )
else if ( shape == QLatin1String( "torus" ) )
return Torus;
else if ( shape == QStringLiteral( "plane" ) )
else if ( shape == QLatin1String( "plane" ) )
return Plane;
else if ( shape == QStringLiteral( "extruded-text" ) )
else if ( shape == QLatin1String( "extruded-text" ) )
return ExtrudedText;
else if ( shape == QStringLiteral( "model" ) )
else if ( shape == QLatin1String( "model" ) )
return Model;
else if ( shape == QStringLiteral( "billboard" ) )
else if ( shape == QLatin1String( "billboard" ) )
return Billboard;
else // "cylinder" (default)
return Cylinder;
@@ -77,7 +77,7 @@ QVariantMap QgsAttributeIndexAlgorithm::processAlgorithm( const QVariantMap &par
QgsVectorLayer *layer = parameterAsVectorLayer( parameters, QStringLiteral( "INPUT" ), context );

if ( !layer )
throw QgsProcessingException( QObject::tr( "Could not load source layer for %1." ).arg( QStringLiteral( "INPUT" ) ) );
throw QgsProcessingException( QObject::tr( "Could not load source layer for %1." ).arg( QLatin1String( "INPUT" ) ) );

QString field = parameterAsString( parameters, QStringLiteral( "FIELD" ), context );

@@ -183,7 +183,7 @@ QgsProcessingAlgorithm::Flags QgsBufferAlgorithm::flags() const
QgsProcessingAlgorithm::VectorProperties QgsBufferAlgorithm::sinkProperties( const QString &sink, const QVariantMap &parameters, QgsProcessingContext &context, const QMap<QString, QgsProcessingAlgorithm::VectorProperties> &sourceProperties ) const
{
QgsProcessingAlgorithm::VectorProperties result;
if ( sink == QStringLiteral( "OUTPUT" ) )
if ( sink == QLatin1String( "OUTPUT" ) )
{
if ( sourceProperties.value( QStringLiteral( "INPUT" ) ).availability == QgsProcessingAlgorithm::Available )
{
@@ -106,37 +106,37 @@ QVariantMap QgsConstantRasterAlgorithm::processAlgorithm( const QVariantMap &par
case 0:
rasterDataType = Qgis::Byte;
if ( value < std::numeric_limits<quint8>::min() || value > std::numeric_limits<quint8>::max() )
throw QgsProcessingException( QObject::tr( "Raster datasets of type %3 only accept positive values between %1 and %2" ).arg( std::numeric_limits<quint8>::min() ).arg( std::numeric_limits<quint8>::max() ).arg( QStringLiteral( "Byte" ) ) );
throw QgsProcessingException( QObject::tr( "Raster datasets of type %3 only accept positive values between %1 and %2" ).arg( std::numeric_limits<quint8>::min() ).arg( std::numeric_limits<quint8>::max() ).arg( QLatin1String( "Byte" ) ) );
if ( fractpart > 0 )
feedback->reportError( QObject::tr( "The entered constant value has decimals but will be written to a raster dataset of type %1. The decimals of the constant value will be omitted." ).arg( QStringLiteral( "Byte" ) ) );
feedback->reportError( QObject::tr( "The entered constant value has decimals but will be written to a raster dataset of type %1. The decimals of the constant value will be omitted." ).arg( QLatin1String( "Byte" ) ) );
break;
case 1:
rasterDataType = Qgis::Int16;
if ( value < std::numeric_limits<qint16>::min() || value > std::numeric_limits<qint16>::max() )
throw QgsProcessingException( QObject::tr( "Raster datasets of type %3 only accept values between %1 and %2" ).arg( std::numeric_limits<qint16>::min() ).arg( std::numeric_limits<qint16>::max() ).arg( QStringLiteral( "Integer16" ) ) );
throw QgsProcessingException( QObject::tr( "Raster datasets of type %3 only accept values between %1 and %2" ).arg( std::numeric_limits<qint16>::min() ).arg( std::numeric_limits<qint16>::max() ).arg( QLatin1String( "Integer16" ) ) );
if ( fractpart > 0 )
feedback->reportError( QObject::tr( "The entered constant value has decimals but will be written to a raster dataset of type %1. The decimals of the constant value will be omitted." ).arg( QStringLiteral( "Integer16" ) ) );
feedback->reportError( QObject::tr( "The entered constant value has decimals but will be written to a raster dataset of type %1. The decimals of the constant value will be omitted." ).arg( QLatin1String( "Integer16" ) ) );
break;
case 2:
rasterDataType = Qgis::UInt16;
if ( value < std::numeric_limits<quint16>::min() || value > std::numeric_limits<quint16>::max() )
throw QgsProcessingException( QObject::tr( "Raster datasets of type %3 only accept positive values between %1 and %2" ).arg( std::numeric_limits<quint16>::min() ).arg( std::numeric_limits<quint16>::max() ).arg( "Unsigned Integer16" ) );
if ( fractpart > 0 )
feedback->reportError( QObject::tr( "The entered constant value has decimals but will be written to a raster dataset of type %1. The decimals of the constant value will be omitted." ).arg( QStringLiteral( "Unsigned Integer16" ) ) );
feedback->reportError( QObject::tr( "The entered constant value has decimals but will be written to a raster dataset of type %1. The decimals of the constant value will be omitted." ).arg( QLatin1String( "Unsigned Integer16" ) ) );
break;
case 3:
rasterDataType = Qgis::Int32;
if ( value < std::numeric_limits<qint32>::min() || value > std::numeric_limits<qint32>::max() )
throw QgsProcessingException( QObject::tr( "Raster datasets of type %3 only accept values between %1 and %2" ).arg( std::numeric_limits<qint32>::min() ).arg( std::numeric_limits<qint32>::max() ).arg( QStringLiteral( "Integer32" ) ) );
throw QgsProcessingException( QObject::tr( "Raster datasets of type %3 only accept values between %1 and %2" ).arg( std::numeric_limits<qint32>::min() ).arg( std::numeric_limits<qint32>::max() ).arg( QLatin1String( "Integer32" ) ) );
if ( fractpart > 0 )
feedback->reportError( QObject::tr( "The entered constant value has decimals but will be written to a raster dataset of type %1. The decimals of the constant value will be omitted." ).arg( QStringLiteral( "Integer32" ) ) );
feedback->reportError( QObject::tr( "The entered constant value has decimals but will be written to a raster dataset of type %1. The decimals of the constant value will be omitted." ).arg( QLatin1String( "Integer32" ) ) );
break;
case 4:
rasterDataType = Qgis::UInt32;
if ( value < std::numeric_limits<quint32>::min() || value > std::numeric_limits<quint32>::max() )
throw QgsProcessingException( QObject::tr( "Raster datasets of type %3 only accept positive values between %1 and %2" ).arg( std::numeric_limits<quint32>::min() ).arg( std::numeric_limits<quint32>::max() ).arg( QStringLiteral( "Unsigned Integer32" ) ) );
throw QgsProcessingException( QObject::tr( "Raster datasets of type %3 only accept positive values between %1 and %2" ).arg( std::numeric_limits<quint32>::min() ).arg( std::numeric_limits<quint32>::max() ).arg( QLatin1String( "Unsigned Integer32" ) ) );
if ( fractpart > 0 )
feedback->reportError( QObject::tr( "The entered constant value has decimals but will be written to a raster dataset of type %1. The decimals of the constant value will be omitted." ).arg( QStringLiteral( "Unsigned Integer32" ) ) );
feedback->reportError( QObject::tr( "The entered constant value has decimals but will be written to a raster dataset of type %1. The decimals of the constant value will be omitted." ).arg( QLatin1String( "Unsigned Integer32" ) ) );
break;
case 5:
rasterDataType = Qgis::Float32;
@@ -72,9 +72,9 @@ QVariantMap QgsExecuteSpatialiteQueryAlgorithm::processAlgorithm( const QVariant
if ( uri.database().isEmpty() )
{
if ( databaseUri.contains( QStringLiteral( "|layername" ), Qt::CaseInsensitive ) )
databaseUri = databaseUri.left( databaseUri.indexOf( QStringLiteral( "|layername" ) ) );
databaseUri = databaseUri.left( databaseUri.indexOf( QLatin1String( "|layername" ) ) );
else if ( databaseUri.contains( QStringLiteral( "|layerid" ), Qt::CaseInsensitive ) )
databaseUri = databaseUri.left( databaseUri.indexOf( QStringLiteral( "|layerid" ) ) );
databaseUri = databaseUri.left( databaseUri.indexOf( QLatin1String( "|layerid" ) ) );

uri = QgsDataSourceUri( QStringLiteral( "dbname='%1'" ).arg( databaseUri ) );
}
@@ -90,7 +90,7 @@ void QgsLayoutAtlasToImageAlgorithm::initAlgorithm( const QVariantMap & )
continue;
imageFormats << QString( format );
}
std::unique_ptr< QgsProcessingParameterEnum > extensionParam = qgis::make_unique< QgsProcessingParameterEnum >( QStringLiteral( "EXTENSION" ), QObject::tr( "Image format" ), imageFormats, false, imageFormats.indexOf( QStringLiteral( "png" ) ) );
std::unique_ptr< QgsProcessingParameterEnum > extensionParam = qgis::make_unique< QgsProcessingParameterEnum >( QStringLiteral( "EXTENSION" ), QObject::tr( "Image format" ), imageFormats, false, imageFormats.indexOf( QLatin1String( "png" ) ) );
extensionParam->setFlags( extensionParam->flags() | QgsProcessingParameterDefinition::FlagAdvanced );
addParameter( extensionParam.release() );

@@ -100,7 +100,7 @@ void QgsLayoutToImageAlgorithm::initAlgorithm( const QVariantMap & )
imageFilters.append( QStringLiteral( "%1 (%2 %3)" ).arg( longName, glob.toLower(), glob.toUpper() ) );
}

addParameter( new QgsProcessingParameterFileDestination( QStringLiteral( "OUTPUT" ), QObject::tr( "Image file" ), imageFilters.join( QStringLiteral( ";;" ) ) ) );
addParameter( new QgsProcessingParameterFileDestination( QStringLiteral( "OUTPUT" ), QObject::tr( "Image file" ), imageFilters.join( QLatin1String( ";;" ) ) ) );
}

QgsProcessingAlgorithm::Flags QgsLayoutToImageAlgorithm::flags() const

0 comments on commit a76670e

Please sign in to comment.
You can’t perform that action at this time.