mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-30 09:10:53 +02:00
* Added support for complex filenames with Taglib.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
|
||||
#ifndef RESULT_H
|
||||
#define RESULT_H
|
||||
|
||||
#include <qvariant.h>
|
||||
|
||||
#include <QObject>
|
||||
@@ -18,7 +18,7 @@ class DLLEXPORT Result : public QObject
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
Result();
|
||||
Result();
|
||||
explicit Result( const QVariant& v, const collection_ptr& collection );
|
||||
virtual ~Result();
|
||||
|
||||
|
@@ -160,7 +160,14 @@ MusicScanner::readFile( const QFileInfo& fi )
|
||||
if( m_scanned % 100 == 0 )
|
||||
qDebug() << "SCAN" << m_scanned << fi.absoluteFilePath();
|
||||
|
||||
TagLib::FileRef f( fi.absoluteFilePath().toUtf8().constData() );
|
||||
#ifdef COMPLEX_TAGLIB_FILENAME
|
||||
const wchar_t *encodedName = reinterpret_cast< const wchar_t *>(fi.absoluteFilePath().utf16());
|
||||
#else
|
||||
QByteArray fileName = QFile::encodeName( fi.absoluteFilePath() );
|
||||
const char *encodedName = fileName.constData();
|
||||
#endif
|
||||
|
||||
TagLib::FileRef f( encodedName );
|
||||
if ( f.isNull() || !f.tag() )
|
||||
{
|
||||
// qDebug() << "Doesn't seem to be a valid audiofile:" << fi.absoluteFilePath();
|
||||
|
Reference in New Issue
Block a user