Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. FITS file mimeDB.mimeTypeForFile() problem
Forum Updated to NodeBB v4.3 + New Features

FITS file mimeDB.mimeTypeForFile() problem

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 266 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • PerdrixP Offline
    PerdrixP Offline
    Perdrix
    wrote on last edited by Perdrix
    #1

    In 6.5.1 the QMimeType object returned for a FITS file was inherited from "image/fits" so this code:

    QFileInfo info{ path };
    QMimeDatabase mimeDB{ };
    auto mime = mimeDB.mimeTypeForFile(info);
    qDebug() << "mime.inherits(\"image/fits\"); returns" << mime.inherits("image/fits");
    

    got me:

    mime.inherits("image/fits"); returns true

    That code in 6.8.0 results in:

    mime.inherits("image/fits"); returns false

    adding a qDebug() << mime; gave me:

    QMimeType("application/fits")

    That's a bit of a NASTY incompatibility.
    David

    1 Reply Last reply
    0
    • C Offline
      C Offline
      ChrisW67
      wrote on last edited by
      #2

      QMimeDatabase will use a system copy of MIME data if one is present (usually Linux) and an internal copy if one is not.

      According to the docs, the built-in copy comes from FreeDesktop shared-mime-info. For Qt 6.5.1 this was release 2.2. This lists "application/fits" as the primary type with alias "image/fits".

      Release 2.1 of this set does list "image/fits". This was last in Qt 6.3.

      Docs notwithstanding, Qt 6.7 switched to a MIME database from Apache Tika . This lists "application/fits" with no aliases.

      Is it possible that the "image/fits" return came from a system database or Qt 6.3 or earlier? My Ubuntu 24.04 has the 2.4 release of the FreeDesktop data.

      1 Reply Last reply
      2

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved