From d5f6b51092f96230c9a0d45c563fa07778c2cf64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20K=C3=B6fferlein?= Date: Sun, 22 Nov 2020 19:53:47 +0000 Subject: [PATCH] Compatibility with Qt 4.6.x on CentOS6 --- src/klayout.pri | 4 ++-- src/tl/tl/tlHttpStreamQt.cc | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/klayout.pri b/src/klayout.pri index 245b3f12d..e7b3807b7 100644 --- a/src/klayout.pri +++ b/src/klayout.pri @@ -160,10 +160,10 @@ equals(HAVE_QT, "0") { } else { DEFINES += HAVE_QT - QT += core network xml sql widgets + QT += core network xml sql equals(HAVE_QT5, "1") { - QT += designer printsupport + QT += designer printsupport widgets equals(HAVE_QTBINDINGS, "1") { QT += multimedia multimediawidgets xmlpatterns svg gui } diff --git a/src/tl/tl/tlHttpStreamQt.cc b/src/tl/tl/tlHttpStreamQt.cc index 48510c697..f022e92ca 100644 --- a/src/tl/tl/tlHttpStreamQt.cc +++ b/src/tl/tl/tlHttpStreamQt.cc @@ -71,7 +71,11 @@ AuthenticationHandler::authenticationRequired (QNetworkReply *reply, QAuthentica // expect UTF-8 today. So do them a favor and encode UTF8 into Latin1, so it gets valid UTF8 when turned into Latin1 ... // We do this for Digest and Basic as they apparently both use Latin 1 encoding. But it's unclear whether all servers // expect UTF-8 encoding. +#if QT_VERSION >= 0x040700 bool is_basic_or_digest = ! auth->option (QString::fromUtf8 ("realm")).isNull (); +#else + bool is_basic_or_digest = true; +#endif if (is_basic_or_digest) { auth->setPassword (QString::fromLatin1 (passwd.c_str ())); auth->setUser (QString::fromLatin1 (user.c_str ())); @@ -98,7 +102,11 @@ AuthenticationHandler::proxyAuthenticationRequired (const QNetworkProxy &proxy, // expect UTF-8 today. So do them a favor and encode UTF8 into Latin1, so it gets valid UTF8 when turned into Latin1 ... // We do this for Digest and Basic as they apparently both use Latin 1 encoding. But it's unclear whether all servers // expect UTF-8 encoding. +#if QT_VERSION >= 0x040700 bool is_basic_or_digest = ! auth->option (QString::fromUtf8 ("realm")).isNull (); +#else + bool is_basic_or_digest = true; +#endif if (is_basic_or_digest) { auth->setPassword (QString::fromLatin1 (passwd.c_str ())); auth->setUser (QString::fromLatin1 (user.c_str ()));