Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-133916

Expand MIME type support

XMLWordPrintable

    • Icon: Suggestion Suggestion
    • Resolution: Unresolved
    • Icon: P3: Somewhat important P3: Somewhat important
    • None
    • 6.9
    • Core: Locales (i18n)
    • None
    • All

      At present we only load the Tika MIME database if we haven't loaded the OpenDesktop.org one. Both count as "internal" for the purposes of the isInternalDatabase() check in this patch-set's QMimeDatabasePrivate::builtinComment(). However, the sets of MIME types they cope with, while overlapping substantially, are very different; each has some data the other lacks. See tst_QMimeDatabase::allMimeTypes() for comments on this.

      When QMimeDatabasePrivate::builtinComment(), new in 6.9, on behalf of QMimeType::comment(), fails to find data for a MIME type in the OpenDesktop.org database, we could fall back to also loading the Tika database (add it to the end of the providers chain) and asking it for a comment.

      In particular, since we now attempt to use Qt's translation system to translate a default (i.e. en-US) comment, and those translations are of the Tika comments, this could improve our ability to successfully find a translation of a Tika comment, for languages to which OpenDesktop.org does not provide a translation, particularly when the two sources have distinct default comments (so our fallback attempt to translate the OpenDesktop.org one fails).

      This would, of course, increase the number of file extensions matching various MIME types, and the overall number of MIME types supported by the database; since these are the subjects of various tests, those tests would need an update. On account of that, this change was not implemented in QTBUG-127004's work, which considered adding the builtinComment() function and associated check.

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            cnn Qt Core & Network
            Eddy Edward Welbourne
            Vladimir Minenko Vladimir Minenko
            Alex Blasche Alex Blasche
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes