Skip to content
Permalink
Browse files
Fix broken signals for AFS/AMS layer addition from the datasource dialog
  • Loading branch information
elpaso committed Sep 11, 2017
1 parent 32dee44 commit 2e8d7f0
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 5 deletions.
@@ -139,3 +139,9 @@ QString QgsAfsSourceSelect::getLayerURI( const QgsOwsConnection &connection,
}
return ds.uri();
}


void QgsAfsSourceSelect::addServiceLayer( QString uri, QString typeName )
{
emit addVectorLayer( uri, typeName );
}
@@ -38,6 +38,10 @@ class QgsAfsSourceSelect: public QgsArcGisServiceSourceSelect
const QString &crs = QString(),
const QString &filter = QString(),
const QgsRectangle &bBox = QgsRectangle() ) const override;
private:
//! A layer is added from the dialog
virtual void addServiceLayer( QString uri, QString typeName );

};

#endif // QGSAFSSOURCESELECT_H
@@ -97,3 +97,8 @@ QString QgsAmsSourceSelect::getLayerURI( const QgsOwsConnection &connection,
ds.setParam( QStringLiteral( "format" ), getSelectedImageEncoding() );
return ds.uri();
}

void QgsAmsSourceSelect::addServiceLayer( QString uri, QString typeName )
{
emit addRasterLayer( uri, typeName, QStringLiteral( "arcgismapserver" ) );
}
@@ -37,6 +37,9 @@ class QgsAmsSourceSelect: public QgsArcGisServiceSourceSelect
const QString &crs = QString(),
const QString &filter = QString(),
const QgsRectangle &bBox = QgsRectangle() ) const override;
private:
//! A layer is added from the dialog
virtual void addServiceLayer( QString uri, QString typeName );
};

#endif // QGSAMSSOURCESELECT_H
@@ -354,7 +354,7 @@ void QgsArcGisServiceSourceSelect::addButtonClicked()
QString uri = getLayerURI( connection, layerTitle, layerName, pCrsString, filter, layerExtent );

QgsDebugMsg( "Layer " + layerName + ", uri: " + uri );
emit addLayer( uri, layerName );
addServiceLayer( uri, layerName );
}
accept();
}
@@ -48,10 +48,6 @@ class QgsArcGisServiceSourceSelect : public QgsAbstractDataSourceWidget, protect
//! Destructor
~QgsArcGisServiceSourceSelect() override;

signals:
//! Emitted when a layer is added from the dialog
void addLayer( QString uri, QString typeName );

protected:
QString mServiceName;
ServiceType mServiceType;
@@ -84,6 +80,9 @@ class QgsArcGisServiceSourceSelect : public QgsAbstractDataSourceWidget, protect
private:
void populateConnectionList();

//! A layer is added from the dialog
virtual void addServiceLayer( QString uri, QString typeName ) = 0;

/** Returns the best suited CRS from a set of authority ids
1. project CRS if contained in the set
2. WGS84 if contained in the set

0 comments on commit 2e8d7f0

Please sign in to comment.