Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Graphics
Okular
Commits
f0323c26
Commit
f0323c26
authored
Jul 13, 2016
by
Martin Tobias Holmedahl Sandsmark
Browse files
Fix duplicate mimetype elimination
parent
99b56887
Changes
1
Hide whitespace changes
Inline
Side-by-side
core/document.cpp
View file @
f0323c26
...
...
@@ -4281,7 +4281,22 @@ QStringList Document::supportedMimeTypes() const
{
result
<<
md
.
mimeTypes
();
}
result
.
removeDuplicates
();
// Remove duplicate mimetypes represented by different names
QMimeDatabase
mimeDatabase
;
QSet
<
QMimeType
>
uniqueMimetypes
;
for
(
const
QString
&
mimeName
:
result
)
{
uniqueMimetypes
.
insert
(
mimeDatabase
.
mimeTypeForName
(
mimeName
));
}
result
.
clear
();
for
(
const
QMimeType
&
mimeType
:
uniqueMimetypes
)
{
result
.
append
(
mimeType
.
name
());
}
// Sorting by mimetype name doesn't make a ton of sense,
// but ensures that the list is ordered the same way every time
qSort
(
result
);
d
->
m_supportedMimeTypes
=
result
;
}
return
result
;
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment