Make this macro work with current Qt versions

Closes #499
This commit is contained in:
Scott Wheeler 2015-05-18 12:42:24 +02:00
parent 0288059495
commit 41a250a15d

View File

@ -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 {