From 41a250a15d9fc1129e1e9f46fc718880f7db7a7d Mon Sep 17 00:00:00 2001 From: Scott Wheeler Date: Mon, 18 May 2015 12:42:24 +0200 Subject: [PATCH] Make this macro work with current Qt versions Closes #499 --- taglib/toolkit/tstring.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/taglib/toolkit/tstring.h b/taglib/toolkit/tstring.h index ab046d8e..57d5e503 100644 --- a/taglib/toolkit/tstring.h +++ b/taglib/toolkit/tstring.h @@ -41,7 +41,12 @@ * \note consider conversion via usual char-by-char for loop to avoid UTF16->UTF8->UTF16 * conversion happening in the background */ + +#if QT_VERSION >= 0x040000 +#define QStringToTString(s) TagLib::String(s.toUtf8().data(), TagLib::String::UTF8) +#else #define QStringToTString(s) TagLib::String(s.utf8().data(), TagLib::String::UTF8) +#endif /*! * \relates TagLib::String @@ -52,6 +57,7 @@ * conversion happening in the background * */ + #define TStringToQString(s) QString::fromUtf8(s.toCString(true)) namespace TagLib { -- 2.40.0