From 2fab93a00a9e183bd8cc653d41dc213bd9be89e4 Mon Sep 17 00:00:00 2001 From: Martchus Date: Fri, 1 Sep 2023 21:51:58 +0200 Subject: [PATCH] Fix compiling tests against Qt 5 --- cli/tests/application.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cli/tests/application.cpp b/cli/tests/application.cpp index 3571fcf..3c3d2a7 100644 --- a/cli/tests/application.cpp +++ b/cli/tests/application.cpp @@ -177,7 +177,11 @@ void ApplicationTests::test() // use environment variables to specify API-key and URL qputenv("SYNCTHING_CTL_API_KEY", apiKey); +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) qputenv("SYNCTHING_CTL_URL", url); +#else + qputenv("SYNCTHING_CTL_URL", QByteArray(url.data(), static_cast(url.size()))); +#endif // test resume, verify via status for dirs only const char *const resumeArgs[] = { "syncthingctl", "resume", "--dir", "test2", nullptr };