1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-07-31 19:30:21 +02:00

Check for COMPLEX_TAGLIB_FILENAME

Fixes crashes on Windows with files that can be indexed but not edited.
This commit is contained in:
Uwe L. Korn
2014-11-07 17:38:44 +01:00
committed by Christian Muehlhaeuser
parent 61bbe8d510
commit ee4675cac7

View File

@@ -36,6 +36,7 @@
#include "Source.h"
#include "Typedefs.h"
#include "config.h"
#include <QDialog>
#include <QDialogButtonBox>
@@ -89,8 +90,12 @@ MetadataEditor::writeMetadata( bool closeDlg )
QFileInfo fi( QUrl( m_result->url() ).toLocalFile() );
bool changed = false;
#ifdef COMPLEX_TAGLIB_FILENAME
const wchar_t *encodedName = fi.canonicalFilePath().toStdWString().c_str();
#else
QByteArray fileName = QFile::encodeName( fi.canonicalFilePath() );
const char *encodedName = fileName.constData();
#endif
TagLib::FileRef f( encodedName );
QSharedPointer<Tomahawk::Tag> tag( Tomahawk::Tag::fromFile( f ) );