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
+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(