From: Olivier Goffart Date: Fri, 5 Feb 2016 14:30:29 +0000 (+0100) Subject: fix compilation with TOKEN_AUTH_ONLY X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~1254^2~24 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=54a278edb9c8108f72187cafd4c7ea1675698817;p=nextcloud-desktop.git fix compilation with TOKEN_AUTH_ONLY --- diff --git a/src/libsync/CMakeLists.txt b/src/libsync/CMakeLists.txt index 52360e1ab..ca56c3e4e 100644 --- a/src/libsync/CMakeLists.txt +++ b/src/libsync/CMakeLists.txt @@ -67,11 +67,16 @@ set(libsync_SRCS creds/dummycredentials.cpp creds/abstractcredentials.cpp creds/credentialscommon.cpp - creds/httpcredentials.cpp ../3rdparty/qjson/json.cpp ../3rdparty/certificates/p12topem.cpp ) +if(TOKEN_AUTH_ONLY) + set (libsync_SRCS ${libsync_SRCS} creds/tokencredentials.cpp) +else() + set (libsync_SRCS ${libsync_SRCS} creds/httpcredentials.cpp) +endif() + # These headers are installed for libowncloudsync to be used by 3rd party apps set(owncloudsync_HEADERS account.h diff --git a/src/libsync/accessmanager.cpp b/src/libsync/accessmanager.cpp index 822f5bac9..a0541c525 100644 --- a/src/libsync/accessmanager.cpp +++ b/src/libsync/accessmanager.cpp @@ -24,10 +24,6 @@ #include "accessmanager.h" #include "utility.h" -#include -#include -#include - namespace OCC { diff --git a/src/libsync/creds/httpcredentials.cpp b/src/libsync/creds/httpcredentials.cpp index fbe78fadd..0530a52e5 100644 --- a/src/libsync/creds/httpcredentials.cpp +++ b/src/libsync/creds/httpcredentials.cpp @@ -17,7 +17,6 @@ #include #include #include -#include #include diff --git a/src/libsync/creds/tokencredentials.cpp b/src/libsync/creds/tokencredentials.cpp index 217e0f8ef..97b6be571 100644 --- a/src/libsync/creds/tokencredentials.cpp +++ b/src/libsync/creds/tokencredentials.cpp @@ -121,11 +121,17 @@ bool TokenCredentials::ready() const return _ready; } -void TokenCredentials::fetch() +void TokenCredentials::fetchFromKeychain() { Q_EMIT fetched(); } +void TokenCredentials::askFromUser() +{ + emit asked(); +} + + bool TokenCredentials::stillValid(QNetworkReply *reply) { return ((reply->error() != QNetworkReply::AuthenticationRequiredError) diff --git a/src/libsync/creds/tokencredentials.h b/src/libsync/creds/tokencredentials.h index adcf32883..cf42a4b24 100644 --- a/src/libsync/creds/tokencredentials.h +++ b/src/libsync/creds/tokencredentials.h @@ -44,7 +44,8 @@ public: QString authType() const Q_DECL_OVERRIDE; QNetworkAccessManager* getQNAM() const Q_DECL_OVERRIDE; bool ready() const Q_DECL_OVERRIDE; - void fetch() Q_DECL_OVERRIDE; + void askFromUser() Q_DECL_OVERRIDE; + void fetchFromKeychain() Q_DECL_OVERRIDE; bool stillValid(QNetworkReply *reply) Q_DECL_OVERRIDE; void persist() Q_DECL_OVERRIDE; QString user() const Q_DECL_OVERRIDE;