]> granicus.if.org Git - taglib/commitdiff
Make this macro work with current Qt versions
authorScott Wheeler <scott@directededge.com>
Mon, 18 May 2015 10:42:24 +0000 (12:42 +0200)
committerScott Wheeler <scott@directededge.com>
Mon, 18 May 2015 10:42:24 +0000 (12:42 +0200)
Closes #499

taglib/toolkit/tstring.h

index ab046d8e4ea031762ac1b868353860396a34aa00..57d5e503e839bd58fd12e1561798e0d578b04906 100644 (file)
  * \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 {