Skip to content
Permalink
Browse files

[ArcGIS Rest] Fix connection key inconsistencies

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

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

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

This comment has been minimized.

Copy link
@nyalldawson

nyalldawson Mar 10, 2017

Collaborator

should that be "ArcGIS"?


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

void QgsAfsConnectionItem::editConnection()
{
QgsNewHttpConnection nc( 0, QStringLiteral( "/Qgis/connections-afs/" ), mName );
nc.setWindowTitle( tr( "Modify AFS connection" ) );
QgsNewHttpConnection nc( 0, QStringLiteral( "/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( QStringLiteral( "ArcGisFeatureServer" ), mName );
QgsOwsConnection::deleteConnection( QStringLiteral( "arcgisfeatureserver" ), mName );
mParent->refresh();
}

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

Q_FOREACH ( const QString &connName, QgsOwsConnection::connectionList( "ArcGisMapServer" ) )
Q_FOREACH ( const QString &connName, QgsOwsConnection::connectionList( "arcgismapserver" ) )
{
QgsOwsConnection connection( QStringLiteral( "ArcGisMapServer" ), connName );
QgsOwsConnection connection( QStringLiteral( "arcgismapserver" ), connName );
QString path = "ams:/" + connName;
connections.append( new QgsAmsConnectionItem( this, connName, path, connection.uri().param( QStringLiteral( "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, QStringLiteral( "/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, QStringLiteral( "/Qgis/connections-afs/" ), mName );
nc.setWindowTitle( tr( "Modify AMS connection" ) );
QgsNewHttpConnection nc( 0, QStringLiteral( "/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( QStringLiteral( "ArcGisMapServer" ), mName );
QgsOwsConnection::deleteConnection( QStringLiteral( "arcgismapserver" ), mName );
mParent->refresh();
}

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

0 comments on commit f5c9275

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