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

Optimization in QMimeDatabasePrivate::mimeTypeForFile does not work for Custom File Engines

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • 6.4.3, 6.5.0, 6.6.0
    • 6.4.1
    • Core: I/O
    • None
    • Linux/Wayland, Linux/X11, Linux/Yocto, Linux/Other display system, macOS
    • 40dd38813 (dev), 02a03f28f (6.4), 88689368d (6.5)

    Description

      https://code.qt.io/cgit/qt/qtbase.git/tree/src/corelib/mimetypes/qmimedatabase.cpp#n446 introduced an optimisation to call QT_STAT directly instead of using QFileInfo on Q_OS_UNIX.

      This does not work for custom FileSystemEngines.

      When the QT_STAT returns != 0, it will then skip the initial check for if it is a directory and may try to open the path as a file and get its contents (which will fail for directories).

      In case the QT_STAT fails, a check using QFileInfo::isDir should still be done first to return directoryMimeType().

      Attachments

        Issue Links

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

          Activity

            People

              thiago Thiago Macieira
              madwinter Marcus Tillmanns
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes