mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2025-04-29 22:24:26 +02:00
Fix icon removal in icon picker (#3410)
This commit is contained in:
commit
8f54a8c8dc
@ -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)
|
||||
|
@ -58,7 +58,7 @@ IconPickerDialog::IconPickerDialog(QWidget* parent) : QDialog(parent), ui(new Ui
|
||||
contentsWidget->setTextElideMode(Qt::ElideRight);
|
||||
contentsWidget->setVerticalScrollMode(QAbstractItemView::ScrollPerPixel);
|
||||
contentsWidget->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||
contentsWidget->setItemDelegate(new ListViewDelegate());
|
||||
contentsWidget->setItemDelegate(new ListViewDelegate(contentsWidget));
|
||||
|
||||
// contentsWidget->setAcceptDrops(true);
|
||||
contentsWidget->setDropIndicatorShown(true);
|
||||
|
Loading…
x
Reference in New Issue
Block a user