<table><tr><td style="">progwolff added inline comments.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D8690" rel="noreferrer">View Revision</a></tr></table><br /><div><strong>INLINE COMMENTS</strong><div><div style="margin: 6px 0 12px 0;"><div style="border: 1px solid #C7CCD9; border-radius: 3px;"><div style="padding: 0; background: #F7F7F7; border-color: #e3e4e8; border-style: solid; border-width: 0 0 1px 0; margin: 0;"><div style="color: #74777d; background: #eff2f4; padding: 6px 8px; overflow: hidden;"><a style="float: right; text-decoration: none;" href="https://phabricator.kde.org/D8690#inline-38589" rel="noreferrer">View Inline</a><span style="color: #4b4d51; font-weight: bold;">aacid</span> wrote in <span style="color: #4b4d51; font-weight: bold;">part.cpp:1400</span></div>
<div style="margin: 8px 0; padding: 0 12px; color: #74777D;"><p style="padding: 0; margin: 8px;">I don't think this is a good idea, do you have an actual case in which this helps or is it just a guess?</p>
<p style="padding: 0; margin: 8px;">Also have you tried that this doesn't break the fixes that <a href="https://phabricator.kde.org/R223:fba90677fcc9ccf0e6f5efe75e7446703d669d36" style="background-color: #e7e7e7;
border-color: #e7e7e7;
border-radius: 3px;
padding: 0 4px;
font-weight: bold;
color: black;text-decoration: none;" rel="noreferrer">fba90677fcc9ccf0e6f5efe75e7446703d669d36</a> speaks of?</p></div></div>
<div style="margin: 8px 0; padding: 0 12px;"><p style="padding: 0; margin: 8px;">Sorry for the delay...</p>
<p style="padding: 0; margin: 8px;">From my understanding of that commit, my changes won't break it. <br />
argMime is only set, if an external application sets the mimeType via OpenUrlArguments. So, the order in 1355 is arbitrary if the file is opened in Okular standalone.</p>
<p style="padding: 0; margin: 8px;">Questionable is, what behaviour we should expect when Okular is used as a KPart and the external application sets the mime type.</p>
<p style="padding: 0; margin: 8px;">Docs say:</p>
<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);">QString KParts::OpenUrlArguments::mimeType ( ) const
The mimetype to use when opening the url, when known by the calling application.
Definition at line 93 of file openurlarguments.cpp.</pre></div>
<p style="padding: 0; margin: 8px;">"The mimetype to use" sounds to me like we should trust the calling application and prefer the mimeType given to us, instead of guessing it from the file name. We still fall back to pathMime if opening it with argMime fails.</p>
<p style="padding: 0; margin: 8px;">An actual usecase would be creating a new rtf/markdown/whatever file in Kate. The new file would not have a file name from which we could derive the mime type from. Without my changes, Okular would guess that it's plain text, as a file name without an ending leads to pathMime "text/plain". It would therefore display the file as plain text, even if Kate knows that it's rtf/markdown/whatever (e.g. from the syntax highlighting mode).<br />
Note that Kate does not do this yet. Just want to give you an example of how it could be used.</p>
<p style="padding: 0; margin: 8px;">The reordering is also needed for the test you demanded.</p>
<blockquote style="border-left: 3px solid #a7b5bf; color: #464c5c; font-style: italic; margin: 4px 0 12px 0; padding: 4px 12px; background-color: #f8f9fc;"><p style="padding: 0; margin: 8px;">I mean maybe what makes sense is to set the mimetype to txt and then giving it a pdf file and checking that the txt backend was used instead of the pdf one?</p></blockquote>
<p style="padding: 0; margin: 8px;">This will not work without the reordering. A pdf file with ending ".pdf" has pathMime "application/pdf" and thus is displayed as pdf, not as plain text, even if argMime is set to "text/plain"</p></div></div></div></div></div><br /><div><strong>REPOSITORY</strong><div><div>R223 Okular</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D8690" rel="noreferrer">https://phabricator.kde.org/D8690</a></div></div><br /><div><strong>To: </strong>progwolff, aacid<br /><strong>Cc: </strong>Okular, ngraham, aacid<br /></div>