Skip to content

Commit 01b97e8

Browse files
committed
sanitization the second
1 parent 1ae1b99 commit 01b97e8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

launcher/icons/IconList.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ void IconList::installIcons(const QStringList &iconFiles)
268268
continue;
269269

270270
const QString sourceHash = getIconHash(sourceFile);
271-
QString sourceFileName = fileinfo.baseName().remove(sourceHash);
271+
QString sourceFileName = fileinfo.baseName().remove("_" + sourceHash).remove(sourceHash);
272272
sourceFileName = QString("%1_%2.%3").arg(sourceFileName, sourceHash, suffix);
273273
QString target = FS::PathCombine(m_dir.dirName(), sourceFileName);
274274

@@ -283,7 +283,7 @@ void IconList::installIcons(const QStringList &iconFiles)
283283
if(sourceHash == targetHash)
284284
continue;
285285

286-
QString targetFileName = fileinfo.baseName().remove(targetHash);
286+
QString targetFileName = fileinfo.baseName().remove("_" + targetHash).remove(targetHash);
287287
targetFileName = QString("%1_%2.%3").arg(targetFileName, targetHash, suffix);
288288
targetFileName = FS::PathCombine(m_dir.dirName(), targetFileName);
289289
if(!targetFile.rename(targetFileName))
@@ -309,7 +309,7 @@ void IconList::installIcon(const QString &file, QString &name)
309309
return;
310310

311311
const QString sourceHash = getIconHash(sourceFile);
312-
name = name.remove(sourceHash);
312+
name = name.remove("_" + sourceHash).remove(sourceHash);
313313
name = QString("%1_%2.%3").arg(name, sourceHash, suffix);
314314
QString target = FS::PathCombine(m_dir.dirName(), name);
315315

@@ -324,7 +324,7 @@ void IconList::installIcon(const QString &file, QString &name)
324324
if(sourceHash == targetHash)
325325
return;
326326

327-
QString targetFileName = QString(name).remove(targetHash);
327+
QString targetFileName = QString(name).remove("_" + targetHash).remove(targetHash);
328328
targetFileName = QString("%1_%2.%3").arg(targetFileName, targetHash, suffix);
329329
targetFileName = FS::PathCombine(m_dir.dirName(), targetFileName);
330330
if(!targetFile.rename(targetFileName))

0 commit comments

Comments
 (0)