mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-04-22 00:42:04 +02:00
Revert "Fix problems with reading files because of filename charsets."
This reverts commit f386de0f0d56991a2e8cbe26edaf5687e15af2e6.
This commit is contained in:
parent
f386de0f0d
commit
893a200b8e
@ -14,10 +14,6 @@ ELSE()
|
||||
ENDIF()
|
||||
|
||||
FIND_PACKAGE( Taglib 1.6.0 REQUIRED )
|
||||
include(CheckTagLibFileName)
|
||||
check_taglib_filename(COMPLEX_TAGLIB_FILENAME)
|
||||
|
||||
|
||||
FIND_PACKAGE( LibLastFm REQUIRED )
|
||||
FIND_PACKAGE( LibEchonest REQUIRED )
|
||||
|
||||
|
@ -1,15 +0,0 @@
|
||||
# taglib changed filenames to be a char/wchar struct on some platforms, need to check for it
|
||||
macro (CHECK_TAGLIB_FILENAME TAGLIB_FILENAME_COMPLEX)
|
||||
include (CheckCXXSourceCompiles)
|
||||
set (CMAKE_REQUIRED_FLAGS ${TAGLIB_CFLAGS})
|
||||
set (CMAKE_REQUIRED_INCLUDES ${TAGLIB_INCLUDES})
|
||||
set (CMAKE_REQUIRED_LIBRARIES ${TAGLIB_LIBRARIES})
|
||||
check_cxx_source_compiles(
|
||||
"#include <tfile.h>
|
||||
int main()
|
||||
{
|
||||
TagLib::FileName fileName1("char");
|
||||
TagLib::FileName fileName2(L"wchar");
|
||||
return 0;
|
||||
}" ${TAGLIB_FILENAME_COMPLEX})
|
||||
endmacro (CHECK_TAGLIB_FILENAME)
|
@ -160,14 +160,7 @@ MusicScanner::readFile( const QFileInfo& fi )
|
||||
if( m_scanned % 100 == 0 )
|
||||
qDebug() << "SCAN" << m_scanned << fi.absoluteFilePath();
|
||||
|
||||
#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 );
|
||||
TagLib::FileRef f( fi.absoluteFilePath().toUtf8().constData() );
|
||||
if ( f.isNull() || !f.tag() )
|
||||
{
|
||||
// qDebug() << "Doesn't seem to be a valid audiofile:" << fi.absoluteFilePath();
|
||||
|
Loading…
x
Reference in New Issue
Block a user