Fix TokenCredentials compilation

This commit is contained in:
Olivier Goffart 2015-02-11 17:33:55 +01:00
parent 7e211ef3d9
commit 4f202e5f4c
3 changed files with 18 additions and 26 deletions

View file

@ -31,9 +31,10 @@ namespace CredentialsFactory
AbstractCredentials* create(const QString& type)
{
#ifdef TOKEN_AUTH_ONLY
Q_UNUSED(type);
return new TokenCredentials;
#else
// empty string might happen for old version of configuration
if (type == "http" || type == "") {
return new HttpCredentialsGui;

View file

@ -165,11 +165,8 @@ bool TokenCredentials::ready() const
return _ready;
}
void TokenCredentials::fetch(Account *account)
void TokenCredentials::fetch()
{
if( !account ) {
return;
}
Q_EMIT fetched();
}
@ -181,22 +178,17 @@ bool TokenCredentials::stillValid(QNetworkReply *reply)
|| !reply->property(authenticationFailedC).toBool()));
}
QString TokenCredentials::queryPassword(bool *ok)
{
return QString();
}
void TokenCredentials::invalidateToken(Account *account)
void TokenCredentials::invalidateToken()
{
qDebug() << Q_FUNC_INFO;
_ready = false;
account->clearCookieJar();
_account->clearCookieJar();
_token = QString();
_user = QString();
_password = QString();
}
void TokenCredentials::persist(Account *account)
void TokenCredentials::persist()
{
}

View file

@ -40,20 +40,19 @@ public:
TokenCredentials();
TokenCredentials(const QString& user, const QString& password, const QString &token);
void syncContextPreInit(CSYNC* ctx);
void syncContextPreStart(CSYNC* ctx);
bool changed(AbstractCredentials* credentials) const;
QString authType() const;
QNetworkAccessManager* getQNAM() const;
bool ready() const;
void fetch();
bool stillValid(QNetworkReply *reply);
void persist();
QString user() const;
QString password() const;
QString queryPassword(bool *ok);
void invalidateToken();
void syncContextPreInit(CSYNC* ctx) Q_DECL_OVERRIDE;
void syncContextPreStart(CSYNC* ctx) Q_DECL_OVERRIDE;
bool changed(AbstractCredentials* credentials) const Q_DECL_OVERRIDE;
QString authType() const Q_DECL_OVERRIDE;
QNetworkAccessManager* getQNAM() const Q_DECL_OVERRIDE;
bool ready() const Q_DECL_OVERRIDE;
void fetch() Q_DECL_OVERRIDE;
bool stillValid(QNetworkReply *reply) Q_DECL_OVERRIDE;
void persist() Q_DECL_OVERRIDE;
QString user() const Q_DECL_OVERRIDE;
void invalidateToken() Q_DECL_OVERRIDE;
QString password() const;
private Q_SLOTS:
void slotAuthentication(QNetworkReply*, QAuthenticator*);