Skip to content

Commit

Permalink
Only show storate type and comment metadata information when present
Browse files Browse the repository at this point in the history
  • Loading branch information
nirvn authored and nyalldawson committed Aug 24, 2021
1 parent dfbbb94 commit 90b104f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/core/mesh/qgsmeshlayer.cpp
Expand Up @@ -25,6 +25,7 @@
#include "qgslogger.h"
#include "qgsmaplayerlegend.h"
#include "qgsmaplayerfactory.h"
#include "qgsmaplayerutils.h"
#include "qgsmeshdataprovider.h"
#include "qgsmeshdatasetgroupstore.h"
#include "qgsmeshlayer.h"
Expand Down
2 changes: 2 additions & 0 deletions src/core/pointcloud/qgspointcloudlayer.cpp
Expand Up @@ -32,6 +32,8 @@
#include "qgsmaplayerlegend.h"
#include "qgsxmlutils.h"
#include "qgsmaplayerfactory.h"
#include "qgsmaplayerutils.h"

#include <QUrl>

QgsPointCloudLayer::QgsPointCloudLayer( const QString &uri,
Expand Down
1 change: 1 addition & 0 deletions src/core/raster/qgsrasterlayer.cpp
Expand Up @@ -24,6 +24,7 @@ email : tim at linfiniti.com
#include "qgslayermetadataformatter.h"
#include "qgslogger.h"
#include "qgsmaplayerlegend.h"
#include "qgsmaplayerutils.h"
#include "qgsmaptopixel.h"
#include "qgsmessagelog.h"
#include "qgsmultibandcolorrenderer.h"
Expand Down
10 changes: 8 additions & 2 deletions src/core/vector/qgsvectorlayer.cpp
Expand Up @@ -5128,10 +5128,16 @@ QString QgsVectorLayer::htmlMetadata() const
myMetadata += QgsMapLayerUtils::generalHtmlMetadata( this );

// storage type
myMetadata += QStringLiteral( "<tr><td class=\"highlight\">" ) + tr( "Storage" ) + QStringLiteral( "</td><td>" ) + storageType() + QStringLiteral( "</td></tr>\n" );
if ( !storageType().isEmpty() )
{
myMetadata += QStringLiteral( "<tr><td class=\"highlight\">" ) + tr( "Storage" ) + QStringLiteral( "</td><td>" ) + storageType() + QStringLiteral( "</td></tr>\n" );
}

// comment
myMetadata += QStringLiteral( "<tr><td class=\"highlight\">" ) + tr( "Comment" ) + QStringLiteral( "</td><td>" ) + dataComment() + QStringLiteral( "</td></tr>\n" );
if ( !dataComment().isEmpty() )
{
myMetadata += QStringLiteral( "<tr><td class=\"highlight\">" ) + tr( "Comment" ) + QStringLiteral( "</td><td>" ) + dataComment() + QStringLiteral( "</td></tr>\n" );
}

// encoding
const QgsVectorDataProvider *provider = dataProvider();
Expand Down

0 comments on commit 90b104f

Please sign in to comment.