diff --git a/src/core/UrlTools.cpp b/src/core/UrlTools.cpp index bd6db52718..7360b48ea9 100644 --- a/src/core/UrlTools.cpp +++ b/src/core/UrlTools.cpp @@ -16,7 +16,7 @@ */ #include "UrlTools.h" -#ifdef WITH_XC_NETWORKING +#if defined(WITH_XC_NETWORKING) || defined(WITH_XC_BROWSER) #include #include #include @@ -40,7 +40,7 @@ QUrl UrlTools::convertVariantToUrl(const QVariant& var) const return url; } -#ifdef WITH_XC_NETWORKING +#if defined(WITH_XC_NETWORKING) || defined(WITH_XC_BROWSER) QUrl UrlTools::getRedirectTarget(QNetworkReply* reply) const { QVariant var = reply->attribute(QNetworkRequest::RedirectionTargetAttribute); diff --git a/src/core/UrlTools.h b/src/core/UrlTools.h index c86152d038..f4d47cc8a1 100644 --- a/src/core/UrlTools.h +++ b/src/core/UrlTools.h @@ -32,7 +32,7 @@ class UrlTools : public QObject explicit UrlTools() = default; static UrlTools* instance(); -#ifdef WITH_XC_NETWORKING +#if defined(WITH_XC_NETWORKING) || defined(WITH_XC_BROWSER) QUrl getRedirectTarget(QNetworkReply* reply) const; QString getBaseDomainFromUrl(const QString& url) const; QString getTopLevelDomainFromUrl(const QString& url) const; diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 4c311b69ef..aaf985c2fa 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -150,8 +150,6 @@ if(WITH_XC_NETWORKING) LIBS ${TEST_LIBRARIES}) add_unit_test(NAME testicondownloader SOURCES TestIconDownloader.cpp LIBS ${TEST_LIBRARIES}) - - add_unit_test(NAME testurltools SOURCES TestUrlTools.cpp LIBS ${TEST_LIBRARIES}) endif() if(WITH_XC_AUTOTYPE) @@ -246,6 +244,10 @@ if(WITH_XC_BROWSER) endif() endif() +if(WITH_XC_NETWORKING OR WITH_XC_BROWSER) + add_unit_test(NAME testurltools SOURCES TestUrlTools.cpp LIBS ${TEST_LIBRARIES}) +endif() + add_unit_test(NAME testcli SOURCES TestCli.cpp LIBS testsupport cli ${TEST_LIBRARIES}) target_compile_definitions(testcli PRIVATE KEEPASSX_CLI_PATH="$")