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

QMimeDatabase: File with "diff" followed by tab character is not recognized as text/x-diff

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: 5.4.1
    • Fix Version/s: 5.4.2
    • Component/s: Core: Other
    • Labels:
      None
    • Commits:
      416438c2f35dc774e4c52a705c5a7098a69647fc

      Description

      #include <QBuffer>
      #include <QMimeDatabase>
      #include <QDebug>
      
      int main(int argc, char *argv[])
      {
          static const char data[] = "diff\t";
          QByteArray d(data);
          QBuffer buff(&d);
          QMimeDatabase mdb;
          qDebug() << mdb.mimeTypeForFileNameAndData(QLatin1String("blah"), &buff).name();
      
          return 0;
      }
      

      is supposed to output text/x-patch, but detects as plain/text.

        Attachments

        For Gerrit Dashboard: QTBUG-44884
        # Subject Branch Project Status CR V

          Activity

            People

            • Assignee:
              con Eike Ziller
              Reporter:
              con Eike Ziller
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Gerrit Reviews

                There are no open Gerrit changes