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 for (
auto ite = mHeaders.constBegin(); ite != mHeaders.constEnd(); ++ite )
143 if ( !keyFixed.isEmpty() )
144 keyFixed = keyFixed +
"/";
149 for (
auto k : settings.
allKeys() )
150 if ( k.startsWith( keyFixed ) )
151 QgsLogger::debug( QString(
"setFromSettings called: %1=%2" ).arg( k, settings.
value( k ).toString() ) );
156 for (
auto ite =
keys.cbegin(); ite !=
keys.cend(); ++ite )
158 if ( ite->startsWith( keyHH ) )
160 QString name = ite->right( ite->size() - keyHH.size() );
161 mHeaders.insert( name, settings.
value( *ite ).toString() );
171 for (
auto k : mHeaders.keys() )
172 QgsLogger::debug( QString(
"setFromSettings mHeaders[%1]=%2" ).arg( k, mHeaders[k].toString() ) );
178 const auto constQueryItems = uri.queryItems( QUrl::ComponentFormattingOption::FullyDecoded );
179 for (
const QPair<QString, QString> &item : constQueryItems )
181 const QString &key = item.first;
196 for (
auto ite = map.keyBegin(); ite != map.keyEnd(); ++ite )
202 mHeaders[
sanitizeKey( name )] = map [key].toString();
215 QDomNamedNodeMap attribs = el.attributes();
217 for (
int i = 0; i < attribs.length(); i++ )
219 QDomNode item = attribs.item( i );
220 QString key = item.nodeName();
238 for (
auto ite = mHeaders.constBegin(); ite != mHeaders.constEnd(); ++ite )
254 QString out = QDir::cleanPath( key );
277 return mHeaders.keys();
289 mHeaders.insert( k2, val );
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.