fix(skin manager): accept files with same name

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
Trial97
2025-05-07 23:56:40 +03:00
parent a89fc7d1e0
commit e1cfae5e06
2 changed files with 28 additions and 3 deletions

View File

@@ -122,7 +122,11 @@ QString SkinModel::name() const
bool SkinModel::rename(QString newName)
{
auto info = QFileInfo(m_path);
m_path = FS::PathCombine(info.absolutePath(), newName + ".png");
auto new_path = FS::PathCombine(info.absolutePath(), newName + ".png");
if (QFileInfo::exists(new_path)) {
return false;
}
m_path = new_path;
return FS::move(info.absoluteFilePath(), m_path);
}