fix null folderIcon

This commit is contained in:
uncor3
2025-11-20 04:00:23 +00:00
parent a02ce2a3d4
commit e85bcc2c8e
3 changed files with 10 additions and 3 deletions
+1
View File
@@ -34,6 +34,7 @@
<file>resources/icons/ClarityEyeHideLine.png</file>
<file>resources/icons/ClarityEyeLine.png</file>
<file>resources/icons/MaterialSymbolsLightImageOutlineSharp.png</file>
<file>resources/icons/MaterialSymbolsFolder.png</file>
<file>qml/MapView.qml</file>
<file>resources/iphone.png</file>
<file>resources/ios-wallpapers/iphone-ios4.png</file>
Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

+9 -3
View File
@@ -221,9 +221,15 @@ void AfcExplorerWidget::loadPath(const QString &path)
QListWidgetItem *item =
new QListWidgetItem(QString::fromStdString(entry.name));
item->setData(Qt::UserRole, entry.isDir);
if (entry.isDir)
item->setIcon(QIcon::fromTheme("folder"));
else {
if (entry.isDir) {
QIcon folderIcon = QIcon::fromTheme("folder");
if (folderIcon.isNull()) {
item->setIcon(
QIcon(":/resources/icons/MaterialSymbolsFolder.png"));
} else {
item->setIcon(folderIcon);
}
} else {
QIcon fileIcon = QIcon::fromTheme("text-x-generic");
if (fileIcon.isNull()) {
item->setIcon(