Skip to content

Commit 2e8d7f0

Browse files
committed
Fix broken signals for AFS/AMS layer addition from the datasource dialog
1 parent 32dee44 commit 2e8d7f0

6 files changed

+22
-5
lines changed

src/providers/arcgisrest/qgsafssourceselect.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -139,3 +139,9 @@ QString QgsAfsSourceSelect::getLayerURI( const QgsOwsConnection &connection,
139139
}
140140
return ds.uri();
141141
}
142+
143+
144+
void QgsAfsSourceSelect::addServiceLayer( QString uri, QString typeName )
145+
{
146+
emit addVectorLayer( uri, typeName );
147+
}

src/providers/arcgisrest/qgsafssourceselect.h

+4
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ class QgsAfsSourceSelect: public QgsArcGisServiceSourceSelect
3838
const QString &crs = QString(),
3939
const QString &filter = QString(),
4040
const QgsRectangle &bBox = QgsRectangle() ) const override;
41+
private:
42+
//! A layer is added from the dialog
43+
virtual void addServiceLayer( QString uri, QString typeName );
44+
4145
};
4246

4347
#endif // QGSAFSSOURCESELECT_H

src/providers/arcgisrest/qgsamssourceselect.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -97,3 +97,8 @@ QString QgsAmsSourceSelect::getLayerURI( const QgsOwsConnection &connection,
9797
ds.setParam( QStringLiteral( "format" ), getSelectedImageEncoding() );
9898
return ds.uri();
9999
}
100+
101+
void QgsAmsSourceSelect::addServiceLayer( QString uri, QString typeName )
102+
{
103+
emit addRasterLayer( uri, typeName, QStringLiteral( "arcgismapserver" ) );
104+
}

src/providers/arcgisrest/qgsamssourceselect.h

+3
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ class QgsAmsSourceSelect: public QgsArcGisServiceSourceSelect
3737
const QString &crs = QString(),
3838
const QString &filter = QString(),
3939
const QgsRectangle &bBox = QgsRectangle() ) const override;
40+
private:
41+
//! A layer is added from the dialog
42+
virtual void addServiceLayer( QString uri, QString typeName );
4043
};
4144

4245
#endif // QGSAMSSOURCESELECT_H

src/providers/arcgisrest/qgsarcgisservicesourceselect.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ void QgsArcGisServiceSourceSelect::addButtonClicked()
354354
QString uri = getLayerURI( connection, layerTitle, layerName, pCrsString, filter, layerExtent );
355355

356356
QgsDebugMsg( "Layer " + layerName + ", uri: " + uri );
357-
emit addLayer( uri, layerName );
357+
addServiceLayer( uri, layerName );
358358
}
359359
accept();
360360
}

src/providers/arcgisrest/qgsarcgisservicesourceselect.h

+3-4
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,6 @@ class QgsArcGisServiceSourceSelect : public QgsAbstractDataSourceWidget, protect
4848
//! Destructor
4949
~QgsArcGisServiceSourceSelect() override;
5050

51-
signals:
52-
//! Emitted when a layer is added from the dialog
53-
void addLayer( QString uri, QString typeName );
54-
5551
protected:
5652
QString mServiceName;
5753
ServiceType mServiceType;
@@ -84,6 +80,9 @@ class QgsArcGisServiceSourceSelect : public QgsAbstractDataSourceWidget, protect
8480
private:
8581
void populateConnectionList();
8682

83+
//! A layer is added from the dialog
84+
virtual void addServiceLayer( QString uri, QString typeName ) = 0;
85+
8786
/** Returns the best suited CRS from a set of authority ids
8887
1. project CRS if contained in the set
8988
2. WGS84 if contained in the set

0 commit comments

Comments
 (0)