Merge pull request #1120 from ispyisail/fix/1117-collection-icon-after-save

Fix #1117: element icon disappears from the collection after saving
This commit is contained in:
Laurent Trinques
2026-09-28 23:18:59 +02:00
committed by GitHub
2 changed files with 17 additions and 0 deletions
@@ -480,6 +480,22 @@ void FileElementCollectionItem::setUpIcon()
}
}
/**
@brief FileElementCollectionItem::clearData
Reset the data, and let setUpIcon() build the icon again.
Without this the guard in setUpIcon() keeps the icon cleared here
empty until the whole collection is reloaded, e.g. after an element
is saved from the element editor (see locationWasSaved()).
*/
void FileElementCollectionItem::clearData()
{
// Reset the flag only after the base class has cleared the icon:
// its setIcon() emits dataChanged(), which re-enters setUpIcon(),
// and that call must still see the flag set and return early.
ElementCollectionItem::clearData();
m_icon_initialized = false;
}
/**
@brief FileElementCollectionItem::setPathName
Set the name of this item in the file system path.
@@ -55,6 +55,7 @@ class FileElementCollectionItem : public ElementCollectionItem
void setUpData() override;
void setUpIcon() override;
void clearData() override;
private:
void setPathName(const QString& path_name,