11#include "qtplatformdependent_p.h"
19QtPlatformDependent::QtPlatformDependent()
26QtPlatformDependent::~QtPlatformDependent()
29 if (m_threadNamHash.contains(currThread)) {
30 if (m_ourNamSet.contains(currThread)) {
31 delete m_threadNamHash[currThread];
33 m_threadNamHash.remove(currThread);
34 m_ourNamSet.remove(currThread);
47 if (m_threadNamHash.contains(currThread) && m_ourNamSet.contains(currThread)) {
48 oldNam = m_threadNamHash[currThread];
54 m_ourNamSet.remove(currThread);
58 m_threadNamHash[currThread] = nam;
59 m_ourNamSet.remove(currThread);
70 if (!m_threadNamHash.contains(currThread)) {
72 m_threadNamHash[currThread] = newNam;
73 m_ourNamSet.insert(currThread);
77 return m_threadNamHash[currThread];
81QList<QUrl> Attica::QtPlatformDependent::getDefaultProviderFiles()
const
84 return QList<QUrl>{
QUrl(QStringLiteral(
"https://autoconfig.kde.org/ocs/providers.xml"))};
87void QtPlatformDependent::addDefaultProviderFile(
const QUrl &)
89 qWarning() <<
"attica-qt does not support default providers yet";
92void QtPlatformDependent::removeDefaultProviderFile(
const QUrl &)
96void QtPlatformDependent::enableProvider(
const QUrl &baseUrl,
bool enabled)
const
100 qWarning() <<
"attica-qt does not support disabling of providers yet";
103bool QtPlatformDependent::isEnabled(
const QUrl &baseUrl)
const
111 return nam()->
post(request, data);
116 return nam()->
post(request, data);
121 return nam()->
put(request, data);
126 return nam()->
put(request, data);
131 return nam()->
get(request);
139bool QtPlatformDependent::hasCredentials(
const QUrl &baseUrl)
const
141 return m_passwords.contains(baseUrl.
toString());
144bool QtPlatformDependent::saveCredentials(
const QUrl &baseUrl,
const QString &user,
const QString &password)
146 m_passwords[baseUrl.
toString()] = QPair<QString, QString>(user, password);
150bool QtPlatformDependent::loadCredentials(
const QUrl &baseUrl,
QString &user,
QString &password)
152 if (!hasCredentials(baseUrl)) {
155 QPair<QString, QString> userPass = m_passwords.value(baseUrl.
toString());
156 user = userPass.
first;
157 password = userPass.second;
161bool Attica::QtPlatformDependent::askForCredentials(
const QUrl &baseUrl,
QString &user,
QString &password)
169bool Attica::QtPlatformDependent::isReady()
QNetworkReply * deleteResource(const QNetworkRequest &request)
QNetworkReply * get(const QNetworkRequest &request)
QNetworkReply * post(const QNetworkRequest &request, QHttpMultiPart *multiPart)
QNetworkReply * put(const QNetworkRequest &request, QHttpMultiPart *multiPart)
QString first(qsizetype n) const const
QThread * currentThread()
QString toString(FormattingOptions options) const const