Skip to content

Commit

Permalink
QString fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Nov 11, 2024
1 parent d45c0fb commit 2897024
Show file tree
Hide file tree
Showing 10 changed files with 86 additions and 86 deletions.
6 changes: 3 additions & 3 deletions src/auth/oauth2/core/qgso2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,9 @@ void QgsO2::setVerificationResponseContent()
if ( verhtml.open( QIODevice::ReadOnly | QIODevice::Text ) )
{
setReplyContent( QString::fromUtf8( verhtml.readAll() )
.replace( QStringLiteral( "{{ H2_TITLE }}" ), tr( "QGIS OAuth2 verification has finished" ) )
.replace( QStringLiteral( "{{ H3_TITLE }}" ), tr( "If you have not been returned to QGIS, bring the application to the forefront." ) )
.replace( QStringLiteral( "{{ CLOSE_WINDOW }}" ), tr( "Close window" ) ).toUtf8()
.replace( QLatin1String( "{{ H2_TITLE }}" ), tr( "QGIS OAuth2 verification has finished" ) )
.replace( QLatin1String( "{{ H3_TITLE }}" ), tr( "If you have not been returned to QGIS, bring the application to the forefront." ) )
.replace( QLatin1String( "{{ CLOSE_WINDOW }}" ), tr( "Close window" ) ).toUtf8()
);
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/core/qgsdiagramrenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1122,19 +1122,19 @@ void QgsStackedDiagramRenderer::_readXmlSubRenderers( const QDomElement &elem, c
{
const QDomElement subRendererElem = childRendererList.at( i ).toElement();

if ( subRendererElem.nodeName() == QStringLiteral( "SingleCategoryDiagramRenderer" ) )
if ( subRendererElem.nodeName() == QLatin1String( "SingleCategoryDiagramRenderer" ) )
{
std::unique_ptr< QgsSingleCategoryDiagramRenderer > singleCatDiagramRenderer = std::make_unique< QgsSingleCategoryDiagramRenderer >();
singleCatDiagramRenderer->readXml( subRendererElem, context );
addRenderer( singleCatDiagramRenderer.release() );
}
else if ( subRendererElem.nodeName() == QStringLiteral( "LinearlyInterpolatedDiagramRenderer" ) )
else if ( subRendererElem.nodeName() == QLatin1String( "LinearlyInterpolatedDiagramRenderer" ) )
{
std::unique_ptr< QgsLinearlyInterpolatedDiagramRenderer > linearDiagramRenderer = std::make_unique< QgsLinearlyInterpolatedDiagramRenderer >();
linearDiagramRenderer->readXml( subRendererElem, context );
addRenderer( linearDiagramRenderer.release() );
}
else if ( subRendererElem.nodeName() == QStringLiteral( "StackedDiagramRenderer" ) )
else if ( subRendererElem.nodeName() == QLatin1String( "StackedDiagramRenderer" ) )
{
std::unique_ptr< QgsStackedDiagramRenderer > stackedDiagramRenderer = std::make_unique< QgsStackedDiagramRenderer >();
stackedDiagramRenderer->readXml( subRendererElem, context );
Expand Down
26 changes: 13 additions & 13 deletions src/core/stac/qgsstaccatalog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,48 +33,48 @@ QString QgsStacCatalog::toHtml() const
{
QString html = QStringLiteral( "<html><head></head>\n<body>\n" );

html += QStringLiteral( "<h1>%1</h1>\n<hr>\n" ).arg( QStringLiteral( "Catalog" ) );
html += QStringLiteral( "<table class=\"list-view\">\n" );
html += QStringLiteral( "<h1>%1</h1>\n<hr>\n" ).arg( QLatin1String( "Catalog") );
html += QLatin1String( "<table class=\"list-view\">\n" );
html += QStringLiteral( "<tr><td class=\"highlight\">%1</td><td>%2</td></tr>\n" ).arg( QStringLiteral( "id" ), id() );
html += QStringLiteral( "<tr><td class=\"highlight\">%1</td><td>%2</td></tr>\n" ).arg( QStringLiteral( "stac_version" ), stacVersion() );
html += QStringLiteral( "<tr><td class=\"highlight\">%1</td><td>%2</td></tr>\n" ).arg( QStringLiteral( "title" ), title() );
html += QStringLiteral( "<tr><td class=\"highlight\">%1</td><td>%2</td></tr>\n" ).arg( QStringLiteral( "description" ), description() );
html += QStringLiteral( "</table>\n" );
html += QLatin1String( "</table>\n" );

if ( !mStacExtensions.isEmpty() )
{
html += QStringLiteral( "<h1>%1</h1>\n<hr>\n" ).arg( QStringLiteral( "Extensions" ) );
html += QStringLiteral( "<ul>\n" );
html += QStringLiteral( "<h1>%1</h1>\n<hr>\n" ).arg( QLatin1String( "Extensions") );
html += QLatin1String( "<ul>\n" );
for ( const QString &extension : mStacExtensions )
{
html += QStringLiteral( "<li>%1</li>\n" ).arg( extension );
}
html += QStringLiteral( "</ul>\n" );
html += QLatin1String( "</ul>\n" );
}

if ( ! mConformanceClasses.isEmpty() )
{
html += QStringLiteral( "<h1>%1</h1>\n<hr>\n" ).arg( QStringLiteral( "Conformance Classes" ) );
html += QStringLiteral( "<ul>\n" );
html += QStringLiteral( "<h1>%1</h1>\n<hr>\n" ).arg( QLatin1String( "Conformance Classes") );
html += QLatin1String( "<ul>\n" );
for ( const QString &cc : mConformanceClasses )
{
html += QStringLiteral( "<li>%1</li>\n" ).arg( cc );
}
html += QStringLiteral( "</ul>\n" );
html += QLatin1String( "</ul>\n" );
}

html += QStringLiteral( "<h1>%1</h1>\n<hr>\n" ).arg( QStringLiteral( "Links" ) );
html += QStringLiteral( "<h1>%1</h1>\n<hr>\n" ).arg( QLatin1String( "Links") );
for ( const QgsStacLink &link : mLinks )
{
html += QStringLiteral( "<table class=\"list-view\">\n" );
html += QLatin1String( "<table class=\"list-view\">\n" );
html += QStringLiteral( "<tr><td class=\"highlight\">%1</td><td>%2</td></tr>\n" ).arg( QStringLiteral( "relation" ), link.relation() );
html += QStringLiteral( "<tr><td class=\"highlight\">%1</td><td>%2</td></tr>\n" ).arg( QStringLiteral( "title" ), link.title() );
html += QStringLiteral( "<tr><td class=\"highlight\">%1</td><td><a href=\"%2\">%2</a></td></tr>\n" ).arg( QStringLiteral( "url" ), link.href() );
html += QStringLiteral( "<tr><td class=\"highlight\">%1</td><td>%2</td></tr>\n" ).arg( QStringLiteral( "type" ), link.mediaType() );
html += QStringLiteral( "</table><br/>\n" );
html += QLatin1String( "</table><br/>\n" );
}

html += QStringLiteral( "\n</body>\n</html>\n" );
html += QLatin1String( "\n</body>\n</html>\n" );
return html;
}

Expand Down
64 changes: 32 additions & 32 deletions src/core/stac/qgsstaccollection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ QString QgsStacCollection::toHtml() const
{
QString html = QStringLiteral( "<html><head></head>\n<body>\n" );

html += QStringLiteral( "<h1>%1</h1>\n<hr>\n" ).arg( QStringLiteral( "Collection" ) );
html += QStringLiteral( "<table class=\"list-view\">\n" );
html += QStringLiteral( "<h1>%1</h1>\n<hr>\n" ).arg( QLatin1String( "Collection") );
html += QLatin1String( "<table class=\"list-view\">\n" );
html += QStringLiteral( "<tr><td class=\"highlight\">%1</td><td>%2</td></tr>\n" ).arg( QStringLiteral( "id" ), id() );
html += QStringLiteral( "<tr><td class=\"highlight\">%1</td><td>%2</td></tr>\n" ).arg( QStringLiteral( "stac_version" ), stacVersion() );
html += QStringLiteral( "<tr><td class=\"highlight\">%1</td><td>%2</td></tr>\n" ).arg( QStringLiteral( "title" ), title() );
Expand All @@ -48,48 +48,48 @@ QString QgsStacCollection::toHtml() const
html += QStringLiteral( "<tr><td class=\"highlight\">%1</td><td>%2</td></tr>\n" ).arg( QStringLiteral( "description" ), descr.toHtml() );
html += QStringLiteral( "<tr><td class=\"highlight\">%1</td><td>%2</td></tr>\n" ).arg( QStringLiteral( "license" ), license() );
html += QStringLiteral( "<tr><td class=\"highlight\">%1</td><td>%2</td></tr>\n" ).arg( QStringLiteral( "keywords" ), keywords().join( ',' ) );
html += QStringLiteral( "</table>\n" );
html += QLatin1String( "</table>\n" );

if ( !mStacExtensions.isEmpty() )
{
html += QStringLiteral( "<h1>%1</h1>\n<hr>\n" ).arg( QStringLiteral( "Extensions" ) );
html += QStringLiteral( "<ul>\n" );
html += QStringLiteral( "<h1>%1</h1>\n<hr>\n" ).arg( QLatin1String( "Extensions") );
html += QLatin1String( "<ul>\n" );
for ( const QString &extension : mStacExtensions )
{
html += QStringLiteral( "<li>%1</li>\n" ).arg( extension );
}
html += QStringLiteral( "</ul>\n" );
html += QLatin1String( "</ul>\n" );
}

if ( ! mConformanceClasses.isEmpty() )
{
html += QStringLiteral( "<h1>%1</h1>\n<hr>\n" ).arg( QStringLiteral( "Conformance Classes" ) );
html += QStringLiteral( "<ul>\n" );
html += QStringLiteral( "<h1>%1</h1>\n<hr>\n" ).arg( QLatin1String( "Conformance Classes") );
html += QLatin1String( "<ul>\n" );
for ( const QString &cc : mConformanceClasses )
{
html += QStringLiteral( "<li>%1</li>\n" ).arg( cc );
}
html += QStringLiteral( "</ul>\n" );
html += QLatin1String( "</ul>\n" );
}

if ( ! mProviders.isEmpty() )
{
html += QStringLiteral( "<h1>%1</h1>\n<hr>\n" ).arg( QStringLiteral( "Providers" ) );
html += QStringLiteral( "<h1>%1</h1>\n<hr>\n" ).arg( QLatin1String( "Providers") );
QTextDocument descr;
for ( const QgsStacProvider &p : mProviders )
{
html += QStringLiteral( "<table class=\"list-view\">\n" );
html += QLatin1String( "<table class=\"list-view\">\n" );
html += QStringLiteral( "<tr><td class=\"highlight\">%1</td><td>%2</td></tr>\n" ).arg( QStringLiteral( "name" ), p.name() );
descr.setMarkdown( p.description() );
html += QStringLiteral( "<tr><td class=\"highlight\">%1</td><td>%2</td></tr>\n" ).arg( QStringLiteral( "description" ), descr.toHtml() );
html += QStringLiteral( "<tr><td class=\"highlight\">%1</td><td>%2</td></tr>\n" ).arg( QStringLiteral( "roles" ), p.roles().join( ',' ) );
html += QStringLiteral( "<tr><td class=\"highlight\">%1</td><td><a href=\"%2\">%2</a></td></tr>\n" ).arg( QStringLiteral( "url" ), p.url() );
html += QStringLiteral( "</table><br/>\n" );
html += QLatin1String( "</table><br/>\n" );
}
}

html += QStringLiteral( "<h1>%1</h1>\n<hr>\n" ).arg( QStringLiteral( "Spatial Extent" ) );
html += QStringLiteral( "<table class=\"list-view\">\n" );
html += QStringLiteral( "<h1>%1</h1>\n<hr>\n" ).arg( QLatin1String( "Spatial Extent") );
html += QLatin1String( "<table class=\"list-view\">\n" );
QString extentString;
if ( mExtent.spatialExtent().is3D() )
extentString = mExtent.spatialExtent().toString();
Expand All @@ -111,70 +111,70 @@ QString QgsStacCollection::toHtml() const
html += QStringLiteral( "<tr><td class=\"highlight\">%1</td><td>%2</td></tr>\n" ).arg( QStringLiteral( "detailed" ), extentString );
}
}
html += QStringLiteral( "</table><br/>\n" );
html += QLatin1String( "</table><br/>\n" );


html += QStringLiteral( "<h1>%1</h1>\n<hr>\n" ).arg( QStringLiteral( "Temporal Extent" ) );
html += QStringLiteral( "<table class=\"list-view\">\n" );
html += QStringLiteral( "<h1>%1</h1>\n<hr>\n" ).arg( QLatin1String( "Temporal Extent") );
html += QLatin1String( "<table class=\"list-view\">\n" );
html += QStringLiteral( "<tr><td class=\"highlight\">%1</td><td>%2</td></tr>\n" ).arg( QStringLiteral( "start" ), mExtent.temporalExtent().begin().toString() );
html += QStringLiteral( "<tr><td class=\"highlight\">%1</td><td>%2</td></tr>\n" ).arg( QStringLiteral( "end" ), mExtent.temporalExtent().end().toString() );
html += QStringLiteral( "</table><br/>\n" );
html += QLatin1String( "</table><br/>\n" );

if ( mExtent.hasDetailedTemporalExtents() )
{
html += QStringLiteral( "Detailed extents:\n" );
html += QLatin1String( "Detailed extents:\n" );
const QVector< QgsDateTimeRange > extents = mExtent.detailedTemporalExtents();
for ( const QgsDateTimeRange &extent : extents )
{
html += QStringLiteral( "<h1>%1</h1>\n<hr>\n" ).arg( QStringLiteral( "Temporal Extent" ) );
html += QStringLiteral( "<table class=\"list-view\">\n" );
html += QStringLiteral( "<h1>%1</h1>\n<hr>\n" ).arg( QLatin1String( "Temporal Extent") );
html += QLatin1String( "<table class=\"list-view\">\n" );
html += QStringLiteral( "<tr><td class=\"highlight\">%1</td><td>%2</td></tr>\n" ).arg( QStringLiteral( "start" ), extent.begin().toString() );
html += QStringLiteral( "<tr><td class=\"highlight\">%1</td><td>%2</td></tr>\n" ).arg( QStringLiteral( "end" ), extent.end().toString() );
html += QStringLiteral( "</table><br/>\n" );
html += QLatin1String( "</table><br/>\n" );
}
}

if ( ! mSummaries.isEmpty() )
{
html += QStringLiteral( "<h1>%1</h1>\n<hr>\n" ).arg( QStringLiteral( "Summaries" ) );
html += QStringLiteral( "<table class=\"list-view\">\n" );
html += QStringLiteral( "<h1>%1</h1>\n<hr>\n" ).arg( QLatin1String( "Summaries") );
html += QLatin1String( "<table class=\"list-view\">\n" );
for ( auto it = mSummaries.constBegin(); it != mSummaries.constEnd(); ++it )
{
html += QStringLiteral( "<tr><td class=\"highlight\">%1</td><td>%2</td></tr>\n" ).arg( it.key(), it.value().toString() );
}
html += QStringLiteral( "</table><br/>\n" );
html += QLatin1String( "</table><br/>\n" );
}

html += QStringLiteral( "<h1>%1</h1>\n<hr>\n" ).arg( QStringLiteral( "Links" ) );
html += QStringLiteral( "<h1>%1</h1>\n<hr>\n" ).arg( QLatin1String( "Links") );
for ( const QgsStacLink &link : mLinks )
{
html += QStringLiteral( "<table class=\"list-view\">\n" );
html += QLatin1String( "<table class=\"list-view\">\n" );
html += QStringLiteral( "<tr><td class=\"highlight\">%1</td><td>%2</td></tr>\n" ).arg( QStringLiteral( "relation" ), link.relation() );
html += QStringLiteral( "<tr><td class=\"highlight\">%1</td><td>%2</td></tr>\n" ).arg( QStringLiteral( "title" ), link.title() );
html += QStringLiteral( "<tr><td class=\"highlight\">%1</td><td><a href=\"%2\">%2</a></td></tr>\n" ).arg( QStringLiteral( "url" ), link.href() );
html += QStringLiteral( "<tr><td class=\"highlight\">%1</td><td>%2</td></tr>\n" ).arg( QStringLiteral( "type" ), link.mediaType() );
html += QStringLiteral( "</table><br/>\n" );
html += QLatin1String( "</table><br/>\n" );
}

if ( ! mAssets.isEmpty() )
{
QTextDocument descr;
html += QStringLiteral( "<h1>%1</h1>\n<hr>\n" ).arg( QStringLiteral( "Assets" ) );
html += QStringLiteral( "<h1>%1</h1>\n<hr>\n" ).arg( QLatin1String( "Assets") );
for ( auto it = mAssets.constBegin(); it != mAssets.constEnd(); ++it )
{
html += QStringLiteral( "<table class=\"list-view\">\n" );
html += QLatin1String( "<table class=\"list-view\">\n" );
html += QStringLiteral( "<tr><td class=\"highlight\">%1</td><td>%2</td></tr>\n" ).arg( QStringLiteral( "id" ), it.key() );
html += QStringLiteral( "<tr><td class=\"highlight\">%1</td><td>%2</td></tr>\n" ).arg( QStringLiteral( "title" ), it->title() );
descr.setMarkdown( it->description() );
html += QStringLiteral( "<tr><td class=\"highlight\">%1</td><td>%2</td></tr>\n" ).arg( QStringLiteral( "description" ), descr.toHtml() );
html += QStringLiteral( "<tr><td class=\"highlight\">%1</td><td><a href=\"%2\">%2</a></td></tr>\n" ).arg( QStringLiteral( "url" ), it->href() );
html += QStringLiteral( "<tr><td class=\"highlight\">%1</td><td>%2</td></tr>\n" ).arg( QStringLiteral( "type" ), it->mediaType() );
html += QStringLiteral( "<tr><td class=\"highlight\">%1</td><td>%2</td></tr>\n" ).arg( QStringLiteral( "roles" ), it->roles().join( ',' ) );
html += QStringLiteral( "</table><br/>\n" );
html += QLatin1String( "</table><br/>\n" );
}
}

html += QStringLiteral( "\n</body>\n</html>\n" );
html += QLatin1String( "\n</body>\n</html>\n" );
return html;
}

Expand Down
4 changes: 2 additions & 2 deletions src/core/stac/qgsstacdataitems.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ bool QgsStacItemItem::hasDragEnabled() const
if ( it->mediaType() == QLatin1String( "image/tiff; application=geotiff; profile=cloud-optimized" ) ||
it->mediaType() == QLatin1String( "image/vnd.stac.geotiff; cloud-optimized=true" ) ||
it->mediaType() == QLatin1String( "application/vnd.laszip+copc" ) ||
it->href().endsWith( QStringLiteral( "/ept.json" ) ) )
it->href().endsWith( QLatin1String( "/ept.json" ) ) )
return true;
}
return false;
Expand Down Expand Up @@ -137,7 +137,7 @@ QgsMimeDataUtils::UriList QgsStacItemItem::mimeUris() const
uri.providerKey = QStringLiteral( "copc" );
uri.uri = it->href();
}
else if ( it->href().endsWith( QStringLiteral( "/ept.json" ) ) )
else if ( it->href().endsWith( QLatin1String( "/ept.json" ) ) )
{
uri.layerType = QStringLiteral( "pointcloud" );
uri.providerKey = QStringLiteral( "ept" );
Expand Down
Loading

0 comments on commit 2897024

Please sign in to comment.