Skip to content
Permalink
Browse files

[ArcGIS Rest] Fix connection key inconsistencies

  • Loading branch information
manisandro committed Mar 13, 2017
1 parent 6b8bcad commit d6f4621b6622341e68dd966260384c2a4e1e793e
@@ -37,9 +37,9 @@ QVector<QgsDataItem*> QgsAfsRootItem::createChildren()
{
QVector<QgsDataItem*> connections;

foreach ( QString connName, QgsOWSConnection::connectionList( "ArcGisFeatureServer" ) )
foreach ( QString connName, QgsOWSConnection::connectionList( "arcgisfeatureserver" ) )
{
QgsOWSConnection connection( "ArcGisFeatureServer", connName );
QgsOWSConnection connection( "arcgisfeatureserver", connName );
QString path = "afs:/" + connName;
connections.append( new QgsAfsConnectionItem( this, connName, path, connection.uri().param( "url" ) ) );
}
@@ -67,8 +67,8 @@ void QgsAfsRootItem::connectionsChanged()

void QgsAfsRootItem::newConnection()
{
QgsNewHttpConnection nc( 0, "/Qgis/connections-afs/" );
nc.setWindowTitle( tr( "Create a new AFS connection" ) );
QgsNewHttpConnection nc( 0, "/Qgis/connections-arcgisfeatureserver/" );
nc.setWindowTitle( tr( "Create a new ArcGISFeatureServer connection" ) );

if ( nc.exec() )
{
@@ -130,8 +130,8 @@ QList<QAction*> QgsAfsConnectionItem::actions()

void QgsAfsConnectionItem::editConnection()
{
QgsNewHttpConnection nc( 0, "/Qgis/connections-afs/", mName );
nc.setWindowTitle( tr( "Modify AFS connection" ) );
QgsNewHttpConnection nc( 0, "/Qgis/connections-arcgisfeatureserver/", mName );
nc.setWindowTitle( tr( "Modify ArcGISFeatureServer connection" ) );

if ( nc.exec() )
{
@@ -141,7 +141,7 @@ void QgsAfsConnectionItem::editConnection()

void QgsAfsConnectionItem::deleteConnection()
{
QgsOWSConnection::deleteConnection( "ArcGisFeatureServer", mName );
QgsOWSConnection::deleteConnection( "arcgisfeatureserver", mName );
mParent->refresh();
}

@@ -66,9 +66,9 @@ QGISEXTERN QgsDataItem *dataItem( QString thePath, QgsDataItem *parentItem )
if ( thePath.startsWith( "afs:/" ) )
{
QString connectionName = thePath.split( '/' ).last();
if ( QgsOWSConnection::connectionList( "ArcGisFeatureServer" ).contains( connectionName ) )
if ( QgsOWSConnection::connectionList( "arcgisfeatureserver" ).contains( connectionName ) )
{
QgsOWSConnection connection( "ArcGisFeatureServer", connectionName );
QgsOWSConnection connection( "arcgisfeatureserver", connectionName );
return new QgsAfsConnectionItem( parentItem, "ArcGisFeatureServer", thePath, connection.uri().param( "url" ) );
}
}
@@ -33,9 +33,9 @@ QVector<QgsDataItem*> QgsAmsRootItem::createChildren()
{
QVector<QgsDataItem*> connections;

foreach ( QString connName, QgsOWSConnection::connectionList( "ArcGisMapServer" ) )
foreach ( QString connName, QgsOWSConnection::connectionList( "arcgismapserver" ) )
{
QgsOWSConnection connection( "ArcGisMapServer", connName );
QgsOWSConnection connection( "arcgismapserver", connName );
QString path = "ams:/" + connName;
connections.append( new QgsAmsConnectionItem( this, connName, path, connection.uri().param( "url" ) ) );
}
@@ -64,8 +64,8 @@ void QgsAmsRootItem::connectionsChanged()

void QgsAmsRootItem::newConnection()
{
QgsNewHttpConnection nc( 0 );
nc.setWindowTitle( tr( "Create a new AMS connection" ) );
QgsNewHttpConnection nc( 0, "/Qgis/connections-arcgismapserver/" );
nc.setWindowTitle( tr( "Create a new ArcGisMapServer connection" ) );

if ( nc.exec() )
{
@@ -145,8 +145,8 @@ QList<QAction*> QgsAmsConnectionItem::actions()

void QgsAmsConnectionItem::editConnection()
{
QgsNewHttpConnection nc( 0, "/Qgis/connections-afs/", mName );
nc.setWindowTitle( tr( "Modify AMS connection" ) );
QgsNewHttpConnection nc( 0, "/Qgis/connections-arcgismapserver/", mName );
nc.setWindowTitle( tr( "Modify ArcGisMapServer connection" ) );

if ( nc.exec() )
{
@@ -156,7 +156,7 @@ void QgsAmsConnectionItem::editConnection()

void QgsAmsConnectionItem::deleteConnection()
{
QgsOWSConnection::deleteConnection( "ArcGisMapServer", mName );
QgsOWSConnection::deleteConnection( "arcgismapserver", mName );
mParent->refresh();
}

@@ -66,9 +66,9 @@ QGISEXTERN QgsDataItem *dataItem( QString thePath, QgsDataItem *parentItem )
if ( thePath.startsWith( "ams:/" ) )
{
QString connectionName = thePath.split( '/' ).last();
if ( QgsOWSConnection::connectionList( "ArcGisMapServer" ).contains( connectionName ) )
if ( QgsOWSConnection::connectionList( "arcgismapserver" ).contains( connectionName ) )
{
QgsOWSConnection connection( "ArcGisMapServer", connectionName );
QgsOWSConnection connection( "arcgismapserver", connectionName );
return new QgsAmsConnectionItem( parentItem, "ArcGisMapServer", thePath, connection.uri().param( "url" ) );
}
}

0 comments on commit d6f4621

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