Use Unicode filenames on Windows (this time the correct patch).

git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@734975 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
This commit is contained in:
Lukáš Lalinský
2007-11-10 16:06:16 +00:00
parent 7b0c053359
commit bb438484da
20 changed files with 134 additions and 49 deletions

View File

@ -59,7 +59,7 @@ FileRef::FileRef()
d = new FileRefPrivate(0);
}
FileRef::FileRef(const char *fileName, bool readAudioProperties,
FileRef::FileRef(FileName fileName, bool readAudioProperties,
AudioProperties::ReadStyle audioPropertiesStyle)
{
d = new FileRefPrivate(create(fileName, readAudioProperties, audioPropertiesStyle));
@ -150,7 +150,7 @@ bool FileRef::operator!=(const FileRef &ref) const
return ref.d->file != d->file;
}
File *FileRef::create(const char *fileName, bool readAudioProperties,
File *FileRef::create(FileName fileName, bool readAudioProperties,
AudioProperties::ReadStyle audioPropertiesStyle) // static
{
@ -164,7 +164,15 @@ File *FileRef::create(const char *fileName, bool readAudioProperties,
// Ok, this is really dumb for now, but it works for testing.
String s = fileName;
String s;
#ifdef _WIN32
if((const wchar_t *)fileName)
s = (const wchar_t *)fileName;
else
s = (const char *)fileName;
#else
s = fileName;
#endif
// If this list is updated, the method defaultFileExtensions() should also be
// updated. However at some point that list should be created at the same time