mirror of
https://github.com/Rosalie241/RMG.git
synced 2026-11-17 19:24:05 +01:00
RMG: account for filenames without a dot in RomBrowserWidget::getCurrentCover()
This commit is contained in:
1 parent
9afd971b43
commit
a6cba2ce2a
1 file changed
+4
-1
@@ -362,7 +362,10 @@ QIcon RomBrowserWidget::getCurrentCover(QString file, CoreRomHeader header, Core
|
||||
// until the end of the string
|
||||
QString baseName = QFileInfo(file).fileName();
|
||||
qsizetype lastIndexOfDot = baseName.lastIndexOf(".");
|
||||
baseName.remove(lastIndexOfDot, baseName.size() - lastIndexOfDot);
|
||||
if (lastIndexOfDot != -1)
|
||||
{ // only remove when index was found
|
||||
baseName.remove(lastIndexOfDot, baseName.size() - lastIndexOfDot);
|
||||
}
|
||||
|
||||
// try to load cover using
|
||||
// 1) basename of file
|
||||
|
||||
Reference in new issue
Block a user