~elementary-pantheon/contractor/contractor-freya

« back to all changes in this revision

Viewing changes to src/MimeTypeManager.vala

  • Committer: Tarmac
  • Author(s): Victor
  • Date: 2013-06-13 20:40:20 UTC
  • mfrom: (128.1.2 contractor)
  • Revision ID: tarmac-20130613204020-tm7wzkumtn122dw9
When matching mimetypes that are incomplete, only compare strings from the beginning.

This is needed to avoid matching unrelated mimetypes when we are only trying to match the parent type.

Fixes lp:1189506

Show diffs side-by-side

added added

removed removed

Lines of Context:
46
46
    }
47
47
 
48
48
    private static bool compare (string mime_type, string ref_mime_type) {
49
 
        return ref_mime_type in mime_type
 
49
        return mime_type.has_prefix (ref_mime_type)
50
50
            || ContentType.equals (mime_type, ref_mime_type)
51
51
            || ContentType.is_a (mime_type, ref_mime_type);
52
52
    }