Summary: | [patch] Mimetype hierarchy not respected in EngineController::canDecode() | ||
---|---|---|---|
Product: | [Applications] amarok | Reporter: | Rafał Rzepecki <divided.mind> |
Component: | Playback | Assignee: | Amarok Developers <amarok-bugs-dist> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | NOR | ||
Version: | 2.3-GIT | ||
Target Milestone: | --- | ||
Platform: | unspecified | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Attachments: | Patch solving the problem |
Description
Rafał Rzepecki
2009-12-23 08:50:02 UTC
Created attachment 39279 [details]
Patch solving the problem
commit bdb9b1af986d58bb104da07f14b730fdd820e40f Author: Mark Kretschmann <kretschmann@kde.org> Date: Wed Dec 23 09:14:27 2009 +0100 More reliable MimeType detection for music formats. Patch by RafaÅ Rzepecki <divided.mind@gmail.com>. BUG: 219792 diff --git a/ChangeLog b/ChangeLog index 8b6e6c5..43c6236 100644 --- a/ChangeLog +++ b/ChangeLog @@ -77,6 +77,8 @@ VERSION 2.2.2 PowerTOP when using the Xine backend. BUGFIXES: + * More reliable MimeType detection for music formats. Patch by RafaÅ + Rzepecki <divided.mind@gmail.com>. (BR 219792) * Fixed regression causing many scripted services, including the, shipped by default, LibriVox service to not work at all. * Fixed corner case that could prevent scans from being completed, diff --git a/src/EngineController.cpp b/src/EngineController.cpp index 55f607f..b055994 100644 --- a/src/EngineController.cpp +++ b/src/EngineController.cpp @@ -219,11 +219,20 @@ EngineController::canDecode( const KUrl &url ) //static mimeTable << "audio/x-m4b"; // MP4 Audio Books have a different extension that KFileItem/Phonon don't grok //mimeTable << "?/?"; //Add comment - const QString mimeType = item.mimetype(); - const bool valid = mimeTable.contains( mimeType, Qt::CaseInsensitive ); + const KMimeType::Ptr mimeType = item.mimeTypePtr(); + + bool valid = false; + foreach( const QString &type, mimeTable ) + { + if( mimeType->is( type ) ) + { + valid = true; + break; + } + } - //we special case this as otherwise users hate us - if ( !valid && ( mimeType == "audio/mp3" || mimeType == "audio/x-mp3" ) && !installDistroCodec() ) + // We special case this, as otherwise the users would hate us + if ( !valid && ( mimeType->is( "audio/mp3" ) || mimeType->is( "audio/x-mp3" ) ) && !installDistroCodec() ) The::statusBar()->longMessage( i18n( "<p>Phonon claims it <b>cannot</b> play MP3 files. You may want to examine " "the installation of the backend that phonon uses.</p>" commit bdb9b1af986d58bb104da07f14b730fdd820e40f Author: Mark Kretschmann <kretschmann@kde.org> Date: Wed Dec 23 09:14:27 2009 +0100 More reliable MimeType detection for music formats. Patch by RafaÅ Rzepecki <divided.mind@gmail.com>. BUG: 219792 diff --git a/ChangeLog b/ChangeLog index 8b6e6c5..43c6236 100644 --- a/ChangeLog +++ b/ChangeLog @@ -77,6 +77,8 @@ VERSION 2.2.2 PowerTOP when using the Xine backend. BUGFIXES: + * More reliable MimeType detection for music formats. Patch by RafaÅ + Rzepecki <divided.mind@gmail.com>. (BR 219792) * Fixed regression causing many scripted services, including the, shipped by default, LibriVox service to not work at all. * Fixed corner case that could prevent scans from being completed, diff --git a/src/EngineController.cpp b/src/EngineController.cpp index 55f607f..b055994 100644 --- a/src/EngineController.cpp +++ b/src/EngineController.cpp @@ -219,11 +219,20 @@ EngineController::canDecode( const KUrl &url ) //static mimeTable << "audio/x-m4b"; // MP4 Audio Books have a different extension that KFileItem/Phonon don't grok //mimeTable << "?/?"; //Add comment - const QString mimeType = item.mimetype(); - const bool valid = mimeTable.contains( mimeType, Qt::CaseInsensitive ); + const KMimeType::Ptr mimeType = item.mimeTypePtr(); + + bool valid = false; + foreach( const QString &type, mimeTable ) + { + if( mimeType->is( type ) ) + { + valid = true; + break; + } + } - //we special case this as otherwise users hate us - if ( !valid && ( mimeType == "audio/mp3" || mimeType == "audio/x-mp3" ) && !installDistroCodec() ) + // We special case this, as otherwise the users would hate us + if ( !valid && ( mimeType->is( "audio/mp3" ) || mimeType->is( "audio/x-mp3" ) ) && !installDistroCodec() ) The::statusBar()->longMessage( i18n( "<p>Phonon claims it <b>cannot</b> play MP3 files. You may want to examine " "the installation of the backend that phonon uses.</p>" |