<p dir="ltr">Agreed on aliases.</p>
<p dir="ltr">As far as inheritance goes... Let's look at it on a case by case basis.</p>
<p dir="ltr">The user opens an HTML file. It opens with Firefox. They set notepad as the app for HTML -> Notepad can now read HTML files.<br>
Notepad should not implicitly be suddenly interested in all text files.</p>
<p dir="ltr">Let's imagine a "b64ark" format which stores multiple files in a base64 plain text format. This format inherits from text/plain but the user associates it with Ark or some such, it doesn't mean ark can read all plaintext files. This would happen a lot with XML files as well for example.</p>
<p dir="ltr">OK now let's imagine Firefox can read XML and svg files. The user doesn't want it to open XML files so removes the assoc. It doesn't mean chrome should stop reading svg files.</p>
<p dir="ltr">With all that in mind I don't think we should care too much about inheritance unless it is explicit.</p>
<div class="gmail_quote">On Nov 9, 2014 8:18 PM, "Ryan Lortie" <<a href="mailto:desrt@desrt.ca">desrt@desrt.ca</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">hi,<br>
<br>
One more nag about the mimeapps spec, while we're at it.<br>
<br>
We didn't take any care to think about aliases and inheritance.<br>
<br>
Aliases are probably relatively easy: I think we should aim to only ever<br>
store the canonical mime type names in the file, and if we are<br>
processing a file with non-canonical names, we should treat it as if we<br>
encountered the canonical name instead.  That means that if someone<br>
added an association at one level for 'application/acrobat' and then at<br>
another level removed 'application/pdf' then the result would be that<br>
the association is broken, regardless of what string is used to do the<br>
lookup.<br>
<br>
Inheritance is more difficult.  What does it mean if, for example, gedit<br>
is listed as an editor for text/plain, but then we specifically list it<br>
as a [Removed] for text/html?  Maybe even more interesting is what<br>
happens if it explicitly listed as text/html but then we remove it for<br>
all of text/plain?  Is it only removed as a fallback, or is it removed<br>
completely for all purposes?<br>
<br>
I don't know that there are "natural" answers to these questions.  In<br>
the case of GLib we have two loops iterating (outer) over all parent<br>
types, in order of most specific to most general, then (inner) over all<br>
desktop file directories.  If we encounter a remove instruction anywhere<br>
on the way, we add the app to a blacklist that we keep for the duration<br>
of the entire operation.  This means that if an app removed for<br>
text/html at any level it will prevent it from being used for text/html<br>
even if it is added again for text/plain from a higher-level directory.<br>
This might sound weird, but consider that removals are probably only<br>
really recorded at the highest-level (ie: user) directory.<br>
<br>
On the other hand it means that if the user removes text/plain then the<br>
behaviour will depend on what exactly was specified in the system<br>
directories.  If text/html was specifically mentioned as being handled<br>
then it will still be handled.  If, however, only text/plain was<br>
mentioned, then the user will have removed this association.  That seems<br>
slightly weird as well.<br>
<br>
I guess it comes down to user intent in a way: what is the user really<br>
wanting to do when they break an association between an generic text<br>
editor and a file named index.html?  Are they breaking an association<br>
between this editor and all text files, or are they only intending to do<br>
it for html?  Maybe the solution to this problem in fact lies in<br>
breaking specifically the association that the application declared?<br>
<br>
I welcome any thoughts on this matter (and particularly if you can state<br>
them more cogently than I've been able to do in this mail).<br>
<br>
Cheers<br>
_______________________________________________<br>
xdg mailing list<br>
<a href="mailto:xdg@lists.freedesktop.org">xdg@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/xdg" target="_blank">http://lists.freedesktop.org/mailman/listinfo/xdg</a><br>
</blockquote></div>