22 const QString QgsGeoNodeConnectionUtils::sPathGeoNodeConnection = QStringLiteral(
"qgis/connections-geonode" );
23 const QString QgsGeoNodeConnectionUtils::sPathGeoNodeConnectionDetails = QStringLiteral(
"qgis/GeoNode" );
31 QString key = settingsKey();
34 mUri.
setParam( QStringLiteral(
"url" ), settings.
value( key + QStringLiteral(
"/url" ), QString() ).toString() );
37 QString username = settings.
value( credentialsKey + QStringLiteral(
"/username" ), QString() ).toString();
38 QString password = settings.
value( credentialsKey + QStringLiteral(
"/password" ), QString() ).toString();
39 if ( !username.isEmpty() )
41 mUri.
setParam( QStringLiteral(
"username" ), username );
42 mUri.
setParam( QStringLiteral(
"password" ), password );
45 QString authcfg = settings.
value( credentialsKey + QStringLiteral(
"/authcfg" ), QString() ).toString();
46 if ( !authcfg.isEmpty() )
48 mUri.
setParam( QStringLiteral(
"authcfg" ), authcfg );
84 QString QgsGeoNodeConnection::settingsKey()
const 99 settings.
beginGroup( QStringLiteral(
"qgis/connections-geonode" ) );
107 settings.
remove( QStringLiteral(
"qgis/connections-geonode/" ) + name );
108 settings.
remove( QStringLiteral(
"qgis/geonode/" ) + name );
113 return sPathGeoNodeConnection;
118 return sPathGeoNodeConnectionDetails;
void remove(const QString &key, const QgsSettings::Section section=QgsSettings::NoSection)
Removes the setting key and any sub-settings of key in a section.
QStringList childGroups() const
Returns a list of all key top-level groups that contain keys that can be read using the QSettings obj...
static QgsDataSourceUri & addWmsWcsConnectionSettings(QgsDataSourceUri &uri, const QString &settingsKey)
Adds uri parameters relating to the settings for a WMS or WCS connection to a QgsDataSourceUri uri...
QgsDataSourceUri uri() const
Returns the URI for the GeoNode connection.
This class is a composition of two QSettings instances:
QgsGeoNodeConnection(const QString &name)
Constructor for a QgsGeoNodeConnection with the specified name.
void setUri(const QgsDataSourceUri &uri)
Sets the uri for the GeoNode connection.
QgsDataSourceUri & addWmsConnectionSettings(QgsDataSourceUri &uri) const
Adds uri parameters relating to the settings for a WMS layer on the connection to a QgsDataSourceUri ...
void beginGroup(const QString &prefix, const QgsSettings::Section section=QgsSettings::NoSection)
Appends prefix to the current group.
QString connectionName() const
Returns the name of the connection.
static void deleteConnection(const QString &name)
Deletes the GeoNode connection with matching name.
void setParam(const QString &key, const QString &value)
Set generic param (generic mode)
static QgsDataSourceUri & addWfsConnectionSettings(QgsDataSourceUri &uri, const QString &settingsKey)
Adds uri parameters relating to the settings for a WFS connection to a QgsDataSourceUri uri...
QVariant value(const QString &key, const QVariant &defaultValue=QVariant(), const Section section=NoSection) const
Returns the value for setting key.
QByteArray encodedUri() const
return complete encoded uri (generic mode)
QgsDataSourceUri & addWfsConnectionSettings(QgsDataSourceUri &uri) const
Adds uri parameters relating to the settings for a WFS layer on the connection to a QgsDataSourceUri ...
static QString pathGeoNodeConnectionDetails()
Returns the base path for settings related to GeoNode connection details.
static QString pathGeoNodeConnection()
Returns the base path for settings related to GeoNode connections.
Class for storing the component parts of a PostgreSQL/RDBMS datasource URI.
static QStringList connectionList()
Returns a list of all known GeoNode connection names.
void setConnectionName(const QString &connectionName)
Sets the name of the connection.