qt6-bb10/tests/auto/gui/itemmodels/qfilesystemmodel
Ahmad Samir 2a8b27bf6c QFileSystemModel: don't crash with setIconProvider(nullptr)
The method takes a pointer, so the code shouldn't crash when passed a
nullptr.

QFileInfoGatherer::getInfo() still needs to generate a descriptive
string for the file, so we refactor QAbstractFileIconProvider::type()
to put the implementation into a reusable static function
QAbstractFileIconProviderPrivate::getFileType(const QFileInfo &info).
This unfortunately involves constructing a QMimeDatabase on the fly,
but the docs say that is fine.

Drive-by change: use nullptr instead of `0` for pointers.

Pick-to: 6.5 6.6 6.7
Fixes: QTBUG-99178
Change-Id: Ia32ea0a26701d593e74fbecced7be8d9e0aa0f52
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2024-02-01 22:06:12 +00:00
..
.gitignore Move QFileSystemModel into QtGui 2020-08-25 06:33:44 +02:00
BLACKLIST Stabilize tst_QFileSystemModel::showFilesOnly test case 2024-01-31 21:18:48 +01:00
CMakeLists.txt CMake: Make gui tests standalone projects 2023-07-05 15:09:32 +02:00
tst_qfilesystemmodel.cpp QFileSystemModel: don't crash with setIconProvider(nullptr) 2024-02-01 22:06:12 +00:00