Check the macro for Qt 4, switch to32Bit() to toWString() since WString is not guaranteed to be a 32-bit string.

git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@769156 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
This commit is contained in:
Scott Wheeler 2008-01-31 17:57:12 +00:00
parent b89272f571
commit 17b769a06e
2 changed files with 12 additions and 2 deletions

View File

@ -247,7 +247,7 @@ std::string String::to8Bit(bool unicode) const
return s;
}
TagLib::wstring String::to32Bit() const
TagLib::wstring String::toWString() const
{
return d->data;
}

View File

@ -47,6 +47,16 @@
*/
#define TStringToQString(s) QString::fromUtf8(s.toCString(true))
#if defined(QT_VERSION_CHECK)
# if QT_VERSION_CHECK(4, 0, 0))
# undef QStringToTSTring
# undef TStringToQString
# define QStringToTString(s) TagLib::String(s.toStdWString())
# define TStringToQString(s) QString::fromStdWString(s.toWString())
# endif
#endif
namespace TagLib {
//! A \e wide string class suitable for unicode.
@ -178,7 +188,7 @@ namespace TagLib {
/*!
* Returns a wstring version of the TagLib string as a wide string.
*/
wstring to32Bit() const;
wstring toWString() const;
/*!
* Creates and returns a C-String based on the data. This string is still