27#include <QNetworkRequest>
31using namespace Qt::StringLiterals;
68 for (
auto ite = mHeaders.constBegin(); ite != mHeaders.constEnd(); ++ite )
70 request.setRawHeader( ite.key().toUtf8(), ite.value().toString().toUtf8() );
77 for (
auto ite = mHeaders.constBegin(); ite != mHeaders.constEnd(); ++ite )
87 if ( !keyFixed.isEmpty() )
88 keyFixed = keyFixed +
"/";
92 for (
auto ite = mHeaders.constBegin(); ite != mHeaders.constEnd(); ++ite )
94 settings.
setValue( keyHH + ite.key(), ite.value() );
105 for (
auto k : settings.
allKeys() )
106 if ( k.startsWith( keyFixed ) )
107 QgsLogger::debug( QString(
"updateSettings in settings: %1=%2" ).arg( k, settings.
value( k ).toString() ) );
114 for (
auto ite = mHeaders.constBegin(); ite != mHeaders.constEnd(); ++ite )
129 QMap<QString, QString> namespaceDeclarations;
136 httpHeaderURIPrefix.chop( 1 );
138 for (
auto ite = mHeaders.constBegin(); ite != mHeaders.constEnd(); ++ite )
140 namespaceDeclarations.insert( httpHeaderURIPrefix, u
"https://qgis.org/"_s + httpHeaderURIPrefix );
156 if ( !keyFixed.isEmpty() )
157 keyFixed = keyFixed +
"/";
162 for (
auto k : settings.
allKeys() )
163 if ( k.startsWith( keyFixed ) )
164 QgsLogger::debug( QString(
"setFromSettings called: %1=%2" ).arg( k, settings.
value( k ).toString() ) );
169 for (
auto ite =
keys.cbegin(); ite !=
keys.cend(); ++ite )
171 if ( ite->startsWith( keyHH ) )
173 QString name = ite->right( ite->size() - keyHH.size() );
174 mHeaders.insert( name, settings.
value( *ite ).toString() );
184 for (
auto k : mHeaders.keys() )
185 QgsLogger::debug( QString(
"setFromSettings mHeaders[%1]=%2" ).arg( k, mHeaders[k].toString() ) );
191 const auto constQueryItems = uri.queryItems( QUrl::ComponentFormattingOption::FullyDecoded );
192 for (
const QPair<QString, QString> &item : constQueryItems )
194 const QString &key = item.first;
209 for (
auto ite = map.keyBegin(); ite != map.keyEnd(); ++ite )
215 mHeaders[
sanitizeKey( name )] = map [key].toString();
228 QDomNamedNodeMap attribs = el.attributes();
230 for (
int i = 0; i < attribs.length(); i++ )
232 QDomNode item = attribs.item( i );
233 QString key = item.nodeName();
251 for (
auto ite = mHeaders.constBegin(); ite != mHeaders.constEnd(); ++ite )
267 QString out = QDir::cleanPath( key );
290 return mHeaders.keys();
302 mHeaders.insert( k2, val );
307 return mHeaders == other.mHeaders;
312 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.
Stores settings for use within QGIS.
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.