Skip to content
Permalink
Browse files

[afs] Fix provider incorrectly overrides provider name and description

with layer name and description
  • Loading branch information
nyalldawson committed Feb 20, 2018
1 parent e3fbb4c commit 227689aced04ed0a54e6a7136dd7ff1f374c0493
Showing with 22 additions and 3 deletions.
  1. +19 −1 src/providers/arcgisrest/qgsafsprovider.cpp
  2. +3 −2 src/providers/arcgisrest/qgsafsprovider.h
@@ -34,6 +34,9 @@
#include <QNetworkReply>


static const QString TEXT_PROVIDER_KEY = QStringLiteral( "arcgisfeatureserver" );
static const QString TEXT_PROVIDER_DESCRIPTION = QStringLiteral( "ArcGIS Feature Server data provider" );

QgsAfsProvider::QgsAfsProvider( const QString &uri )
: QgsVectorDataProvider( uri )
, mValid( false )
@@ -204,6 +207,21 @@ QgsRectangle QgsAfsProvider::extent() const
return mSharedData->extent();
}

QString QgsAfsProvider::name() const
{
return TEXT_PROVIDER_KEY;
}

QString QgsAfsProvider::description() const
{
return TEXT_PROVIDER_DESCRIPTION;
}

QString QgsAfsProvider::dataComment() const
{
return mLayerDescription;
}

void QgsAfsProvider::reloadData()
{
mSharedData->clearCache();
@@ -217,7 +235,7 @@ class QgsAfsSourceSelectProvider : public QgsSourceSelectProvider
{
public:

QString providerKey() const override { return QStringLiteral( "arcgisfeatureserver" ); }
QString providerKey() const override { return TEXT_PROVIDER_KEY; }
QString text() const override { return QObject::tr( "ArcGIS Feature Server" ); }
int ordering() const override { return QgsSourceSelectProvider::OrderRemoteProvider + 150; }
QIcon icon() const override { return QgsApplication::getThemeIcon( QStringLiteral( "/mActionAddAfsLayer.svg" ) ); }
@@ -64,8 +64,9 @@ class QgsAfsProvider : public QgsVectorDataProvider
/* Read only for the moment
void updateExtents() override{}
*/
QString name() const override { return mLayerName; }
QString description() const override { return mLayerDescription; }
QString name() const override;
QString description() const override;
QString dataComment() const override;
void reloadData() override;

private:

0 comments on commit 227689a

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