Skip to content

Commit

Permalink
add some missing QLatin1String in metadataHtml()
Browse files Browse the repository at this point in the history
  • Loading branch information
Gustry authored and nyalldawson committed Sep 4, 2018
1 parent 5a87567 commit 6a80069
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
24 changes: 12 additions & 12 deletions src/core/metadata/qgslayermetadataformatter.cpp
Expand Up @@ -57,15 +57,15 @@ QString QgsLayerMetadataFormatter::contactsSectionHtml() const
}
else
{
myMetadata = QStringLiteral( "<table width=\"100%\" class=\"tabular-view\">\n" );
myMetadata += "<tr><th>" + QObject::tr( "ID" ) + "</th><th>" + QObject::tr( "Name" ) + "</th><th>" + QObject::tr( "Position" ) + "</th><th>" + QObject::tr( "Organization" ) + "</th><th>" + QObject::tr( "Role" ) + "</th><th>" + QObject::tr( "Email" ) + "</th><th>" + QObject::tr( "Voice" ) + "</th><th>" + QObject::tr( "Fax" ) + "</th><th>" + QObject::tr( "Addresses" ) + "</th></tr>\n";
myMetadata += QStringLiteral( "<table width=\"100%\" class=\"tabular-view\">\n" );
myMetadata += QLatin1String( "<tr><th>" ) + QObject::tr( "ID" ) + QLatin1String( "</th><th>" ) + QObject::tr( "Name" ) + QLatin1String( "</th><th>" ) + QObject::tr( "Position" ) + QLatin1String( "</th><th>" ) + QObject::tr( "Organization" ) + QLatin1String( "</th><th>" ) + QObject::tr( "Role" ) + QLatin1String( "</th><th>" ) + QObject::tr( "Email" ) + QLatin1String( "</th><th>" ) + QObject::tr( "Voice" ) + QLatin1String( "</th><th>" ) + QObject::tr( "Fax" ) + QLatin1String( "</th><th>" ) + QObject::tr( "Addresses" ) + QLatin1String( "</th></tr>\n" );
int i = 1;
for ( const QgsAbstractMetadataBase::Contact &contact : contacts )
{
QString rowClass;
if ( i % 2 )
rowClass = QStringLiteral( "class=\"odd-row\"" );
myMetadata += "<tr " + rowClass + "><td>" + QString::number( i ) + "</td><td>" + contact.name + "</td><td>" + contact.position + "</td><td>" + contact.organization + "</td><td>" + contact.role + "</td><td>" + contact.email + "</td><td>" + contact.voice + "</td><td>" + contact.fax + "</td><td>";
myMetadata += QLatin1String( "<tr " ) + rowClass + QLatin1String( "><td>" ) + QString::number( i ) + QLatin1String( "</td><td>" ) + contact.name + QLatin1String( "</td><td>" ) + contact.position + QLatin1String( "</td><td>" ) + contact.organization + QLatin1String( "</td><td>" ) + contact.role + QLatin1String( "</td><td>" ) + contact.email + QLatin1String( "</td><td>" ) + contact.voice + QLatin1String( "</td><td>" ) + contact.fax + QLatin1String( "</td><td>" );
bool notFirstRow = false;
for ( const QgsAbstractMetadataBase::Address &oneAddress : contact.addresses )
{
Expand Down Expand Up @@ -143,7 +143,7 @@ QString QgsLayerMetadataFormatter::extentSectionHtml() const
myMetadata += QStringLiteral( "<strong>" ) + QObject::tr( "Y Minimum" ) + QStringLiteral( ": </strong>" ) + qgsDoubleToString( spatialExtent.bounds.yMinimum() ) + QStringLiteral( "<br />" );
myMetadata += QStringLiteral( "<strong>" ) + QObject::tr( "X Maximum" ) + QStringLiteral( ": </strong>" ) + qgsDoubleToString( spatialExtent.bounds.xMaximum() ) + QStringLiteral( "<br />" );
myMetadata += QStringLiteral( "<strong>" ) + QObject::tr( "Y Maximum" ) + QStringLiteral( ": </strong>" ) + qgsDoubleToString( spatialExtent.bounds.yMaximum() ) + QStringLiteral( "<br />" );
if ( spatialExtent.bounds.zMinimum() || spatialExtent.bounds.zMinimum() )
if ( spatialExtent.bounds.zMinimum() || spatialExtent.bounds.zMaximum() )
{
myMetadata += QStringLiteral( "<strong>" ) + QObject::tr( "Z Minimum" ) + QStringLiteral( ": </strong>" ) + qgsDoubleToString( spatialExtent.bounds.zMinimum() ) + QStringLiteral( "<br />" );
myMetadata += QStringLiteral( "<strong>" ) + QObject::tr( "Z Maximum" ) + QStringLiteral( ": </strong>" ) + qgsDoubleToString( spatialExtent.bounds.zMaximum() );
Expand Down Expand Up @@ -207,15 +207,15 @@ QString QgsLayerMetadataFormatter::identificationSectionHtml() const
if ( i.hasNext() )
{
myMetadata += QStringLiteral( "<table width=\"100%\" class=\"tabular-view\">\n" );
myMetadata += "<tr><th>" + QObject::tr( "Vocabulary" ) + "</th><th>" + QObject::tr( "Items" ) + "</th></tr>\n";
myMetadata += QLatin1String( "<tr><th>" ) + QObject::tr( "Vocabulary" ) + QLatin1String( "</th><th>" ) + QObject::tr( "Items" ) + QLatin1String( "</th></tr>\n" );
int j = 1;
while ( i.hasNext() )
{
i.next();
QString rowClass;
if ( j % 2 )
rowClass = QStringLiteral( "class=\"odd-row\"" );
myMetadata += "<tr " + rowClass + "><td>" + i.key() + "</td><td>" + i.value().join( QStringLiteral( ", " ) ) + "</td></tr>\n";
myMetadata += QLatin1String( "<tr " ) + rowClass + QLatin1String( "><td>" ) + i.key() + QLatin1String( "</td><td>" ) + i.value().join( QStringLiteral( ", " ) ) + QLatin1String( "</td></tr>\n" );
j++;
}
myMetadata += QLatin1String( "</table>\n" ); // End keywords table
Expand All @@ -235,15 +235,15 @@ QString QgsLayerMetadataFormatter::historySectionHtml() const
}
else
{
myMetadata = QStringLiteral( "<table width=\"100%\" class=\"tabular-view\">\n" );
myMetadata += "<tr><th>" + QObject::tr( "ID" ) + "</th><th>" + QObject::tr( "Action" ) + "</th></tr>\n";
myMetadata += QStringLiteral( "<table width=\"100%\" class=\"tabular-view\">\n" );
myMetadata += QLatin1String( "<tr><th>" ) + QObject::tr( "ID" ) + QLatin1String( "</th><th>" ) + QObject::tr( "Action" ) + QLatin1String( "</th></tr>\n" );
int i = 1;
for ( const QString &history : historyItems )
{
QString rowClass;
if ( i % 2 )
rowClass = QStringLiteral( "class=\"odd-row\"" );
myMetadata += "<tr " + rowClass + "><td width=\"5%\">" + QString::number( i ) + "</td><td>" + history + "</td></tr>\n";
myMetadata += QLatin1String( "<tr " ) + rowClass + QLatin1String( "><td width=\"5%\">" ) + QString::number( i ) + QLatin1String( "</td><td>" ) + history + QLatin1String( "</td></tr>\n" );
i++;
}
myMetadata += QLatin1String( "</table>\n" );
Expand All @@ -261,15 +261,15 @@ QString QgsLayerMetadataFormatter::linksSectionHtml() const
}
else
{
myMetadata = QStringLiteral( "<table width=\"100%\" class=\"tabular-view\">\n" );
myMetadata += "<tr><th>" + QObject::tr( "ID" ) + "</th><th>" + QObject::tr( "Name" ) + "</th><th>" + QObject::tr( "Type" ) + "</th><th>" + QObject::tr( "URL" ) + "</th><th>" + QObject::tr( "Description" ) + "</th><th>" + QObject::tr( "Format" ) + "</th><th>" + QObject::tr( "MIME Type" ) + "</th><th>" + QObject::tr( "Size" ) + "</th></tr>\n";
myMetadata += QStringLiteral( "<table width=\"100%\" class=\"tabular-view\">\n" );
myMetadata += QLatin1String( "<tr><th>" ) + QObject::tr( "ID" ) + QLatin1String( "</th><th>" ) + QObject::tr( "Name" ) + QLatin1String( "</th><th>" ) + QObject::tr( "Type" ) + QLatin1String( "</th><th>" ) + QObject::tr( "URL" ) + QLatin1String( "</th><th>" ) + QObject::tr( "Description" ) + QLatin1String( "</th><th>" ) + QObject::tr( "Format" ) + QLatin1String( "</th><th>" ) + QObject::tr( "MIME Type" ) + QLatin1String( "</th><th>" ) + QObject::tr( "Size" ) + QLatin1String( "</th></tr>\n" );
int i = 1;
for ( const QgsAbstractMetadataBase::Link &link : links )
{
QString rowClass;
if ( i % 2 )
rowClass = QStringLiteral( "class=\"odd-row\"" );
myMetadata += "<tr " + rowClass + "><td>" + QString::number( i ) + "</td><td>" + link.name + "</td><td>" + link.type + "</td><td>" + link.url + "</td><td>" + link.description + "</td><td>" + link.format + "</td><td>" + link.mimeType + "</td><td>" + link.size + "</td></tr>\n";
myMetadata += QLatin1String( "<tr " ) + rowClass + QLatin1String( "><td>" ) + QString::number( i ) + QLatin1String( "</td><td>" ) + link.name + QLatin1String( "</td><td>" ) + link.type + QLatin1String( "</td><td>" ) + link.url + QLatin1String( "</td><td>" ) + link.description + QLatin1String( "</td><td>" ) + link.format + QLatin1String( "</td><td>" ) + link.mimeType + QLatin1String( "</td><td>" ) + link.size + QLatin1String( "</td></tr>\n" );
i++;
}
myMetadata += QLatin1String( "</table>\n" );
Expand Down
4 changes: 2 additions & 2 deletions src/core/qgsvectorlayer.cpp
Expand Up @@ -4307,15 +4307,15 @@ QString QgsVectorLayer::htmlMetadata() const
myMetadata += QStringLiteral( "<tr><td class=\"highlight\">" ) + tr( "Count" ) + QStringLiteral( "</td><td>" ) + QString::number( myFields.size() ) + QStringLiteral( "</td></tr>\n" );

myMetadata += QLatin1String( "</table>\n<br><table width=\"100%\" class=\"tabular-view\">\n" );
myMetadata += "<tr><th>" + tr( "Field" ) + "</th><th>" + tr( "Type" ) + "</th><th>" + tr( "Length" ) + "</th><th>" + tr( "Precision" ) + "</th><th>" + tr( "Comment" ) + "</th></tr>\n";
myMetadata += QLatin1String( "<tr><th>" ) + tr( "Field" ) + QLatin1String( "</th><th>" ) + tr( "Type" ) + QLatin1String( "</th><th>" ) + tr( "Length" ) + QLatin1String( "</th><th>" ) + tr( "Precision" ) + QLatin1String( "</th><th>" ) + tr( "Comment" ) + QLatin1String( "</th></tr>\n" );

for ( int i = 0; i < myFields.size(); ++i )
{
QgsField myField = myFields.at( i );
QString rowClass;
if ( i % 2 )
rowClass = QStringLiteral( "class=\"odd-row\"" );
myMetadata += "<tr " + rowClass + "><td>" + myField.name() + "</td><td>" + myField.typeName() + "</td><td>" + QString::number( myField.length() ) + "</td><td>" + QString::number( myField.precision() ) + "</td><td>" + myField.comment() + "</td></tr>\n";
myMetadata += QLatin1String( "<tr " ) + rowClass + QLatin1String( "><td>" ) + myField.name() + QLatin1String( "</td><td>" ) + myField.typeName() + QLatin1String( "</td><td>" ) + QString::number( myField.length() ) + QLatin1String( "</td><td>" ) + QString::number( myField.precision() ) + QLatin1String( "</td><td>" ) + myField.comment() + QLatin1String( "</td></tr>\n" );
}

//close field list
Expand Down
10 changes: 5 additions & 5 deletions src/core/raster/qgsrasterlayer.cpp
Expand Up @@ -439,15 +439,15 @@ QString QgsRasterLayer::htmlMetadata() const

// Band table
myMetadata += QLatin1String( "</table>\n<br><table width=\"100%\" class=\"tabular-view\">\n" );
myMetadata += "<tr><th>" + tr( "Number" ) + "</th><th>" + tr( "Band" ) + "</th><th>" + tr( "No-Data" ) + "</th><th>" + tr( "Min" ) + "</th><th>" + tr( "Max" ) + "</th></tr>\n";
myMetadata += QLatin1String( "<tr><th>" ) + tr( "Number" ) + QLatin1String( "</th><th>" ) + tr( "Band" ) + QLatin1String( "</th><th>" ) + tr( "No-Data" ) + QLatin1String( "</th><th>" ) + tr( "Min" ) + QLatin1String( "</th><th>" ) + tr( "Max" ) + QLatin1String( "</th></tr>\n" );

QgsRasterDataProvider *provider = const_cast< QgsRasterDataProvider * >( mDataProvider );
for ( int i = 1; i <= bandCount(); i++ )
{
QString rowClass;
if ( i % 2 )
rowClass = QStringLiteral( "class=\"odd-row\"" );
myMetadata += "<tr " + rowClass + "><td>" + QString::number( i ) + "</td><td>" + bandName( i ) + "</td><td>";
myMetadata += QLatin1String( "<tr " ) + rowClass + QLatin1String( "><td>" ) + QString::number( i ) + QLatin1String( "</td><td>" ) + bandName( i ) + QLatin1String( "</td><td>" );

if ( dataProvider()->sourceHasNoDataValue( i ) )
myMetadata += QString::number( dataProvider()->sourceNoDataValue( i ) );
Expand All @@ -458,12 +458,12 @@ QString QgsRasterLayer::htmlMetadata() const
if ( provider->hasStatistics( i ) )
{
QgsRasterBandStats myRasterBandStats = provider->bandStatistics( i );
myMetadata += "<td>" + QString::number( myRasterBandStats.minimumValue, 'f', 10 ) + "</td>";
myMetadata += "<td>" + QString::number( myRasterBandStats.maximumValue, 'f', 10 ) + "</td>";
myMetadata += QLatin1String( "<td>" ) + QString::number( myRasterBandStats.minimumValue, 'f', 10 ) + QLatin1String( "</td>" );
myMetadata += QLatin1String( "<td>" ) + QString::number( myRasterBandStats.maximumValue, 'f', 10 ) + QLatin1String( "</td>" );
}
else
{
myMetadata += "<td>" + tr( "n/a" ) + "</td><td>" + tr( "n/a" ) + "</td>";
myMetadata += QLatin1String( "<td>" ) + tr( "n/a" ) + QLatin1String( "</td><td>" ) + tr( "n/a" ) + QLatin1String( "</td>" );
}

myMetadata += QLatin1String( "</tr>\n" );
Expand Down

0 comments on commit 6a80069

Please sign in to comment.