Skip to content
Permalink
Browse files

Cleanup QgsOwsConnection

  • Loading branch information
nyalldawson committed Sep 12, 2017
1 parent 51922fc commit 4c8733853a6f18c586ab16ada0dd1d924d2e1560
@@ -28,6 +28,33 @@ class QgsOwsConnection : QObject
\param connName connection name
%End

QString connectionName() const;
%Docstring
Returns the connection name.
.. versionadded:: 3.0
:rtype: str
%End

QString connectionInfo() const;
%Docstring
Returns connection info string.
.. versionadded:: 3.0
:rtype: str
%End

QString service() const;
%Docstring
Returns a string representing the service type, e.g. "WMS".
.. versionadded:: 3.0
:rtype: str
%End

QgsDataSourceUri uri() const;
%Docstring
Returns the connection uri.
:rtype: QgsDataSourceUri
%End

static QStringList connectionList( const QString &service );
%Docstring
Returns the list of connections for the specified service
@@ -49,15 +76,8 @@ Retrieves the selected connection for the specified service
Marks the specified connection for the specified service as selected
%End

QString mConnName;
QgsDataSourceUri uri() const;
%Docstring
Returns the connection uri
:rtype: QgsDataSourceUri
%End
QString mConnectionInfo;

protected:

};


@@ -106,6 +106,21 @@ QgsOwsConnection::QgsOwsConnection( const QString &service, const QString &connN
QgsDebugMsg( QString( "encoded uri: '%1'." ).arg( QString( mUri.encodedUri() ) ) );
}

QString QgsOwsConnection::connectionName() const
{
return mConnName;
}

QString QgsOwsConnection::connectionInfo() const
{
return mConnectionInfo;
}

QString QgsOwsConnection::service() const
{
return mService;
}

QgsDataSourceUri QgsOwsConnection::uri() const
{
return mUri;
@@ -44,6 +44,29 @@ class CORE_EXPORT QgsOwsConnection : public QObject
*/
QgsOwsConnection( const QString &service, const QString &connName );

/**
* Returns the connection name.
* \since QGIS 3.0
*/
QString connectionName() const;

/**
* Returns connection info string.
* \since QGIS 3.0
*/
QString connectionInfo() const;

/**
* Returns a string representing the service type, e.g. "WMS".
* \since QGIS 3.0
*/
QString service() const;

/**
* Returns the connection uri.
*/
QgsDataSourceUri uri() const;

//! Returns the list of connections for the specified service
static QStringList connectionList( const QString &service );

@@ -55,14 +78,15 @@ class CORE_EXPORT QgsOwsConnection : public QObject
//! Marks the specified connection for the specified service as selected
static void setSelectedConnection( const QString &service, const QString &name );

QString mConnName;
//! Returns the connection uri
QgsDataSourceUri uri() const;
QString mConnectionInfo;

protected:
QgsDataSourceUri mUri;

private:

QString mConnName;
QString mService;
QString mConnectionInfo;

};


@@ -21,7 +21,7 @@
QgsWfsConnection::QgsWfsConnection( const QString &connName )
: QgsOwsConnection( QStringLiteral( "WFS" ), connName )
{
const QString &key = QgsWFSConstants::CONNECTIONS_WFS + mConnName;
const QString &key = QgsWFSConstants::CONNECTIONS_WFS + connectionName();

QgsSettings settings;

0 comments on commit 4c87338

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