Changeset View
Changeset View
Standalone View
Standalone View
attica-kde/kdeplugin/kdeplatformdependent.h
Show All 26 Lines | |||||
27 | 27 | | |||
28 | #include <attica/platformdependent.h> | 28 | #include <attica/platformdependent.h> | ||
29 | 29 | | |||
30 | #include <QHash> | 30 | #include <QHash> | ||
31 | 31 | | |||
32 | #include <KSharedConfig> | 32 | #include <KSharedConfig> | ||
33 | #include <KIO/AccessManager> | 33 | #include <KIO/AccessManager> | ||
34 | 34 | | |||
35 | | ||||
36 | namespace KWallet { | | |||
37 | class Wallet; | | |||
38 | } | | |||
39 | | ||||
40 | namespace Attica { | 35 | namespace Attica { | ||
41 | 36 | | |||
42 | class KdePlatformDependent : public QObject, public Attica::PlatformDependent | 37 | class KdePlatformDependent : public QObject, public Attica::PlatformDependent | ||
43 | { | 38 | { | ||
44 | Q_OBJECT | 39 | Q_OBJECT | ||
45 | Q_INTERFACES(Attica::PlatformDependent) | 40 | Q_INTERFACES(Attica::PlatformDependent) | ||
46 | Q_PLUGIN_METADATA(IID "org.kde.attica-kde") | 41 | Q_PLUGIN_METADATA(IID "org.kde.attica-kde") | ||
47 | 42 | | |||
Show All 11 Lines | 43 | public: | |||
59 | QNetworkReply* get(const QNetworkRequest& request) override; | 54 | QNetworkReply* get(const QNetworkRequest& request) override; | ||
60 | bool saveCredentials(const QUrl& baseUrl, const QString& user, const QString& password) override; | 55 | bool saveCredentials(const QUrl& baseUrl, const QString& user, const QString& password) override; | ||
61 | bool hasCredentials(const QUrl& baseUrl) const override; | 56 | bool hasCredentials(const QUrl& baseUrl) const override; | ||
62 | bool loadCredentials(const QUrl& baseUrl, QString& user, QString& password) override; | 57 | bool loadCredentials(const QUrl& baseUrl, QString& user, QString& password) override; | ||
63 | bool askForCredentials(const QUrl& baseUrl, QString& user, QString& password) override; | 58 | bool askForCredentials(const QUrl& baseUrl, QString& user, QString& password) override; | ||
64 | QNetworkAccessManager* nam() override; | 59 | QNetworkAccessManager* nam() override; | ||
65 | 60 | | |||
66 | private: | 61 | private: | ||
67 | bool openWallet(bool force); | 62 | QNetworkRequest addOAuthToRequest(const QNetworkRequest& request); | ||
68 | QNetworkRequest removeAuthFromRequest(const QNetworkRequest& request); | 63 | QNetworkRequest removeAuthFromRequest(const QNetworkRequest& request); | ||
64 | QString getAccessToken(const QUrl& baseUrl) const; | ||||
69 | 65 | | |||
70 | KSharedConfigPtr m_config; | 66 | KSharedConfigPtr m_config; | ||
71 | QNetworkAccessManager* m_accessManager = nullptr; | 67 | QNetworkAccessManager* m_accessManager{nullptr}; | ||
72 | KWallet::Wallet* m_wallet = nullptr; | | |||
73 | QHash<QString, QPair <QString, QString> > m_passwords; | 68 | QHash<QString, QPair <QString, QString> > m_passwords; | ||
74 | }; | 69 | }; | ||
75 | 70 | | |||
76 | } | 71 | } | ||
77 | 72 | | |||
78 | 73 | | |||
79 | #endif | 74 | #endif |