Fix icon removal in icon picker (#3410)

This commit is contained in:
Alexandru Ionut Tripon
2025-04-15 16:58:13 +03:00
committed by GitHub
2 changed files with 5 additions and 3 deletions

View File

@@ -165,7 +165,8 @@ void IconList::directoryChanged(const QString& path)
for (const MMCIcon& it : m_icons) {
if (!it.has(IconType::FileBased))
continue;
currentSet.insert(it.m_images[IconType::FileBased].filename);
QFileInfo icon(it.getFilePath());
currentSet.insert(icon.absoluteFilePath());
}
QSet<QString> toRemove = currentSet - newSet;
QSet<QString> toAdd = newSet - currentSet;
@@ -173,7 +174,8 @@ void IconList::directoryChanged(const QString& path)
for (const QString& removedPath : toRemove) {
qDebug() << "Removing icon " << removedPath;
QFileInfo removedFile(removedPath);
QString key = m_dir.relativeFilePath(removedFile.absoluteFilePath());
QString relativePath = m_dir.relativeFilePath(removedFile.absoluteFilePath());
QString key = QFileInfo(relativePath).completeBaseName();
int idx = getIconIndex(key);
if (idx == -1)