diff options
Diffstat (limited to 'src/gui/itemmodels/qfilesystemmodel_p.h')
-rw-r--r-- | src/gui/itemmodels/qfilesystemmodel_p.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/gui/itemmodels/qfilesystemmodel_p.h b/src/gui/itemmodels/qfilesystemmodel_p.h index 7c9e41622e..e01b0d56e6 100644 --- a/src/gui/itemmodels/qfilesystemmodel_p.h +++ b/src/gui/itemmodels/qfilesystemmodel_p.h @@ -150,8 +150,12 @@ public: return visibleChildren.indexOf(childName); } void updateIcon(QAbstractFileIconProvider *iconProvider, const QString &path) { + if (!iconProvider) + return; + if (info) info->icon = iconProvider->icon(QFileInfo(path)); + for (QFileSystemNode *child : std::as_const(children)) { //On windows the root (My computer) has no path so we don't want to add a / for nothing (e.g. /C:/) if (!path.isEmpty()) { @@ -165,6 +169,9 @@ public: } void retranslateStrings(QAbstractFileIconProvider *iconProvider, const QString &path) { + if (!iconProvider) + return; + if (info) info->displayType = iconProvider->type(QFileInfo(path)); for (QFileSystemNode *child : std::as_const(children)) { |