26#include <QNetworkRequest>
65 for (
auto ite = mHeaders.constBegin(); ite != mHeaders.constEnd(); ++ite )
67 request.setRawHeader( ite.key().toUtf8(), ite.value().toString().toUtf8() );
74 for (
auto ite = mHeaders.constBegin(); ite != mHeaders.constEnd(); ++ite )
84 if ( !keyFixed.isEmpty() )
85 keyFixed = keyFixed +
"/";
89 for (
auto ite = mHeaders.constBegin(); ite != mHeaders.constEnd(); ++ite )
91 settings.
setValue( keyHH + ite.key(), ite.value() );
102 for (
auto k : settings.
allKeys() )
103 if ( k.startsWith( keyFixed ) )
104 QgsLogger::debug( QString(
"updateSettings in settings: %1=%2" ).arg( k, settings.
value( k ).toString() ) );
111 for (
auto ite = mHeaders.constBegin(); ite != mHeaders.constEnd(); ++ite )
126 QMap<QString, QString> namespaceDeclarations;
133 httpHeaderURIPrefix.chop( 1 );
135 for (
auto ite = mHeaders.constBegin(); ite != mHeaders.constEnd(); ++ite )
137 namespaceDeclarations.insert( httpHeaderURIPrefix, QStringLiteral(
"https://qgis.org/" ) + httpHeaderURIPrefix );
153 if ( !keyFixed.isEmpty() )
154 keyFixed = keyFixed +
"/";
159 for (
auto k : settings.
allKeys() )
160 if ( k.startsWith( keyFixed ) )
161 QgsLogger::debug( QString(
"setFromSettings called: %1=%2" ).arg( k, settings.
value( k ).toString() ) );
166 for (
auto ite =
keys.cbegin(); ite !=
keys.cend(); ++ite )
168 if ( ite->startsWith( keyHH ) )
170 QString name = ite->right( ite->size() - keyHH.size() );
171 mHeaders.insert( name, settings.
value( *ite ).toString() );
181 for (
auto k : mHeaders.keys() )
182 QgsLogger::debug( QString(
"setFromSettings mHeaders[%1]=%2" ).arg( k, mHeaders[k].toString() ) );
188 const auto constQueryItems = uri.queryItems( QUrl::ComponentFormattingOption::FullyDecoded );
189 for (
const QPair<QString, QString> &item : constQueryItems )
191 const QString &key = item.first;
206 for (
auto ite = map.keyBegin(); ite != map.keyEnd(); ++ite )
212 mHeaders[
sanitizeKey( name )] = map [key].toString();
225 QDomNamedNodeMap attribs = el.attributes();
227 for (
int i = 0; i < attribs.length(); i++ )
229 QDomNode item = attribs.item( i );
230 QString key = item.nodeName();
248 for (
auto ite = mHeaders.constBegin(); ite != mHeaders.constEnd(); ++ite )
264 QString out = QDir::cleanPath( key );
287 return mHeaders.keys();
299 mHeaders.insert( k2, val );
304 return mHeaders == other.mHeaders;
309 return !( *
this == other );
static void debug(const QString &msg, int debuglevel=1, const char *file=nullptr, const char *function=nullptr, int line=-1)
Goes to qDebug.
This class is a composition of two QSettings instances:
QVariant value(const QString &key, const QVariant &defaultValue=QVariant(), Section section=NoSection) const
Returns the value for setting key.
bool contains(const QString &key, QgsSettings::Section section=QgsSettings::NoSection) const
Returns true if there exists a setting called key; returns false otherwise.
void remove(const QString &key, QgsSettings::Section section=QgsSettings::NoSection)
Removes the setting key and any sub-settings of key in a section.
void setValue(const QString &key, const QVariant &value, QgsSettings::Section section=QgsSettings::NoSection)
Sets the value of setting key to value.
QStringList allKeys() const
Returns a list of all keys, including subkeys, that can be read using the QSettings object.