Skip to content
Permalink
Browse files

[afs] Add error browser item when connection fails

(cherry-picked from 5503af8)
  • Loading branch information
nyalldawson committed Jul 25, 2018
1 parent a6650f4 commit 79b70844b3fbbd31f4be5fe5b3a6d73019bf9344
Showing with 7 additions and 0 deletions.
  1. +7 −0 src/providers/arcgisrest/qgsafsdataitems.cpp
@@ -102,6 +102,13 @@ QVector<QgsDataItem *> QgsAfsConnectionItem::createChildren()
const QVariantMap serviceData = QgsArcGisRestUtils::getServiceInfo( url, errorTitle, errorMessage );
if ( serviceData.isEmpty() )
{
if ( !errorMessage.isEmpty() )
{
std::unique_ptr< QgsErrorItem > error = qgis::make_unique< QgsErrorItem >( this, tr( "Connection failed: %1" ).arg( errorTitle ), mPath + "/error" );
error->setToolTip( errorMessage );
layers.append( error.release() );
QgsDebugMsg( "Connection failed - " + errorMessage );
}
return layers;
}
const QString authid = QgsArcGisRestUtils::parseSpatialReference( serviceData.value( QStringLiteral( "spatialReference" ) ).toMap() ).authid();

0 comments on commit 79b7084

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