Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
KDE Libraries
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Unmaintained
KDE Libraries
Commits
7a0244bd
Commit
7a0244bd
authored
13 years ago
by
David Faure
Browse files
Options
Downloads
Patches
Plain Diff
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
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
kio/kio/kfileitem.cpp
+10
-3
10 additions, 3 deletions
kio/kio/kfileitem.cpp
with
10 additions
and
3 deletions
kio/kio/kfileitem.cpp
+
10
−
3
View file @
7a0244bd
...
...
@@ -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
i
f the
main one hasn't been determined for sure
if
(
!
d
->
m_bMimeTypeKnown
&&
!
d
->
m_guessedMimeType
.
isEmpty
()
)
// Use guessed mimetype f
or
the
icon
if
(
!
d
->
m_guessedMimeType
.
isEmpty
())
mime
=
KMimeType
::
mimeType
(
d
->
m_guessedMimeType
);
else
mime
=
d
->
m_pMimeType
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment