mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
Cleanup QgsOwsConnection
This commit is contained in:
parent
51922fc74c
commit
4c8733853a
@ -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;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user