From: Scott Wheeler Date: Mon, 18 May 2015 10:42:24 +0000 (+0200) Subject: Make this macro work with current Qt versions X-Git-Tag: v1.10beta~107 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=41a250a15d9fc1129e1e9f46fc718880f7db7a7d;p=taglib Make this macro work with current Qt versions Closes #499 --- 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 {