Skip to content

Commit

Permalink
MAYA-130936: Disabled mime based file type determination (qt#94)
Browse files Browse the repository at this point in the history
Using file extension to determine the file type instead of mime-type.
  • Loading branch information
senthilauto2023 authored and GitHub Enterprise committed Dec 6, 2023
1 parent 34e72dc commit a9b7395
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/gui/image/qabstractfileiconprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,12 +239,15 @@ QString QAbstractFileIconProvider::type(const QFileInfo &info) const
if (QFileSystemEntry::isRootPath(info.absoluteFilePath()))
return QGuiApplication::translate("QAbstractFileIconProvider", "Drive");
if (info.isFile()) {
#if QT_CONFIG(mimetype)
#if 0 //QT_CONFIG(mimetype)
const QMimeType mimeType = d->mimeDatabase.mimeTypeForFile(info);
return mimeType.comment().isEmpty() ? mimeType.name() : mimeType.comment();
#else
Q_UNUSED(d);
return QGuiApplication::translate("QAbstractFileIconProvider", "File");
if (!info.suffix().isEmpty()) {
//: %1 is a file name suffix, for example txt
return QGuiApplication::translate("QAbstractFileIconProvider", "%1 File").arg(info.suffix());
}
return QGuiApplication::translate("QAbstractFileIconProvider", "File");
#endif
}

Expand Down

0 comments on commit a9b7395

Please sign in to comment.