Skip to content
Snippets Groups Projects
Commit 7a0244bd authored by David Faure's avatar David Faure
Browse files

Fix support for 'guessed mimetype' in iconName, using Dawit's testcase

parent b54533f7
No related branches found
No related tags found
No related merge requests found
......@@ -814,7 +814,14 @@ QString KFileItem::iconName() const
bool isLocalUrl;
KUrl url = mostLocalUrl(isLocalUrl);
KMimeType::Ptr mime = mimeTypePtr();
KMimeType::Ptr mime;
// Use guessed mimetype for the icon
if (!d->m_guessedMimeType.isEmpty()) {
mime = KMimeType::mimeType( d->m_guessedMimeType );
} else {
mime = mimeTypePtr();
}
if (isLocalUrl && !isSlow() && mime->is("application/x-desktop")) {
d->m_iconName = iconFromDesktopFile(url.toLocalFile());
if (!d->m_iconName.isEmpty()) {
......@@ -947,8 +954,8 @@ QPixmap KFileItem::pixmap( int _size, int _state ) const
}
KMimeType::Ptr mime;
// Use guessed mimetype if the main one hasn't been determined for sure
if ( !d->m_bMimeTypeKnown && !d->m_guessedMimeType.isEmpty() )
// Use guessed mimetype for the icon
if (!d->m_guessedMimeType.isEmpty())
mime = KMimeType::mimeType( d->m_guessedMimeType );
else
mime = d->m_pMimeType;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment