Fix compiling tests against Qt 5

This commit is contained in:
Martchus 2023-09-01 21:51:58 +02:00
parent c168231172
commit 2fab93a00a
1 changed files with 4 additions and 0 deletions

View File

@ -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<int>(url.size())));
#endif
// test resume, verify via status for dirs only
const char *const resumeArgs[] = { "syncthingctl", "resume", "--dir", "test2", nullptr };