From ea6aa5ef309dd699107cb9ac810cd56a85971b28 Mon Sep 17 00:00:00 2001 From: Alberto Mardegan Date: Tue, 21 May 2019 18:51:41 +0300 Subject: [PATCH] [buteo-sync-plugins-social] Allow building without sailfishkeyprovider Signed-off-by: Mike Gabriel --- src/common.pri | 6 +++++- src/google/googledatatypesyncadaptor.cpp | 6 ++++++ 2 files changed, 11 insertions(+), 1 deletion(-) --- a/src/common.pri +++ b/src/common.pri @@ -1,12 +1,16 @@ CONFIG += link_pkgconfig PKGCONFIG += \ - libsailfishkeyprovider \ libsignon-qt5 \ accounts-qt5 \ buteosyncfw5 \ socialcache +packagesExist(libsailfishkeyprovider) { + PKGCONFIG += libsailfishkeyprovider + DEFINES += USE_SAILFISHKEYPROVIDER +} + QT += \ network \ dbus \ --- a/src/google/googledatatypesyncadaptor.cpp +++ b/src/google/googledatatypesyncadaptor.cpp @@ -28,8 +28,10 @@ #include #include +#ifdef USE_SAILFISHKEYPROVIDER // libsailfishkeyprovider #include +#endif // libaccounts-qt5 #include @@ -170,6 +172,7 @@ void GoogleDataTypeSyncAdaptor::loadClientIdAndSecret() { +#ifdef USE_SAILFISHKEYPROVIDER m_triedLoading = true; char *cClientId = NULL; char *cClientSecret = NULL; @@ -195,6 +198,7 @@ m_clientSecret = QLatin1String(cClientSecret); free(cClientSecret); +#endif } void GoogleDataTypeSyncAdaptor::setCredentialsNeedUpdate(Accounts::Account *account) @@ -247,8 +251,10 @@ } QVariantMap signonSessionData = accSrv.authData().parameters(); +#ifdef USE_SAILFISHKEYPROVIDER signonSessionData.insert("ClientId", clientId()); signonSessionData.insert("ClientSecret", clientSecret()); +#endif signonSessionData.insert("UiPolicy", SignOn::NoUserInteractionPolicy); connect(session, &SignOn::AuthSession::response,