Skip to content

Commit 4aaed2a

Browse files
committed
WMS identify format preference order: Html,Feature,Text
1 parent db95b46 commit 4aaed2a

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

src/app/qgsidentifyresultsdialog.cpp

+6-7
Original file line numberDiff line numberDiff line change
@@ -440,15 +440,14 @@ void QgsIdentifyResultsDialog::addFeature( QgsRasterLayer *layer,
440440

441441
QComboBox *formatCombo = new QComboBox();
442442

443-
// Add all supported formats, best first. Note that all providers should support
444-
// IdentifyFormatHtml and IdentifyFormatText because other formats may be
445-
// converted to them
443+
// Add all supported formats, best first. HTML is considered the best because
444+
// it usually holds most informations.
446445
int capabilities = layer->dataProvider()->capabilities();
447446
QList<QgsRasterDataProvider::IdentifyFormat> formats;
448-
formats << QgsRasterDataProvider::IdentifyFormatFeature
449-
<< QgsRasterDataProvider::IdentifyFormatValue
450-
<< QgsRasterDataProvider::IdentifyFormatHtml
451-
<< QgsRasterDataProvider::IdentifyFormatText;
447+
formats << QgsRasterDataProvider::IdentifyFormatHtml
448+
<< QgsRasterDataProvider::IdentifyFormatFeature
449+
<< QgsRasterDataProvider::IdentifyFormatText
450+
<< QgsRasterDataProvider::IdentifyFormatValue;
452451
foreach ( QgsRasterDataProvider::IdentifyFormat f, formats )
453452
{
454453
if ( !( QgsRasterDataProvider::identifyFormatToCapability( f ) & capabilities ) ) continue;

src/core/raster/qgsrasterlayer.cpp

+9-8
Original file line numberDiff line numberDiff line change
@@ -1709,22 +1709,23 @@ void QgsRasterLayer::setDataProvider( QString const & provider )
17091709
// Set default identify format - use the richest format available
17101710
int capabilities = mDataProvider->capabilities();
17111711
QgsRasterDataProvider::IdentifyFormat identifyFormat = QgsRasterDataProvider::IdentifyFormatUndefined;
1712-
if ( capabilities & QgsRasterInterface::IdentifyFeature )
1712+
if ( capabilities & QgsRasterInterface::IdentifyHtml )
17131713
{
1714-
identifyFormat = QgsRasterDataProvider::IdentifyFormatFeature;
1715-
}
1716-
else if ( capabilities & QgsRasterInterface::IdentifyValue )
1717-
{
1718-
identifyFormat = QgsRasterDataProvider::IdentifyFormatValue;
1714+
// HTML is usually richest
1715+
identifyFormat = QgsRasterDataProvider::IdentifyFormatHtml;
17191716
}
1720-
else if ( capabilities & QgsRasterInterface::IdentifyHtml )
1717+
else if ( capabilities & QgsRasterInterface::IdentifyFeature )
17211718
{
1722-
identifyFormat = QgsRasterDataProvider::IdentifyFormatHtml;
1719+
identifyFormat = QgsRasterDataProvider::IdentifyFormatFeature;
17231720
}
17241721
else if ( capabilities & QgsRasterInterface::IdentifyText )
17251722
{
17261723
identifyFormat = QgsRasterDataProvider::IdentifyFormatText;
17271724
}
1725+
else if ( capabilities & QgsRasterInterface::IdentifyValue )
1726+
{
1727+
identifyFormat = QgsRasterDataProvider::IdentifyFormatValue;
1728+
}
17281729
setCustomProperty( "identify/format", QgsRasterDataProvider::identifyFormatName( identifyFormat ) );
17291730

17301731
// Store timestamp

0 commit comments

Comments
 (0)