kioslave: fix build with curl v7.73.0+

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2022-04-10 23:43:08 +03:00
parent 25b5133f26
commit d0d29ef693
2 changed files with 5 additions and 3 deletions

View file

@ -69,7 +69,8 @@ set_package_properties(ENCHANT PROPERTIES
PURPOSE "Spell checking support via Enchant"
)
find_package(CURL)
# v7.43.0+ required for CURL_AT_LEAST_VERSION() macro
find_package(CURL 7.43.0)
set_package_properties(CURL PROPERTIES
DESCRIPTION "Command line tool and library for transferring data with URLs"
URL "https://curl.se/"

View file

@ -39,8 +39,7 @@ static inline curl_proxytype curlProxyType(const QString &proxy)
{
const QString proxyprotocol = KUrl(proxy).protocol();
// added in 7.52.0
#ifdef CURLPROXY_HTTPS
#if CURL_AT_LEAST_VERSION(7, 52, 0)
if (proxyprotocol.startsWith(QLatin1String("https"))) {
return CURLPROXY_HTTPS;
}
@ -79,7 +78,9 @@ static inline KIO::Error KIOError(const CURLcode curlcode)
case CURLE_URL_MALFORMAT: {
return KIO::ERR_MALFORMED_URL;
}
#if CURL_AT_LEAST_VERSION(7, 73, 0)
case CURLE_PROXY:
#endif
case CURLE_COULDNT_RESOLVE_PROXY: {
return KIO::ERR_UNKNOWN_PROXY_HOST;
}