mirror of https://github.com/PCSX2/pcsx2.git
Qt: Fix changing cover file formats
This commit is contained in:
parent
ce96d4bcc5
commit
de0d859502
|
@ -2285,7 +2285,8 @@ void MainWindow::setGameListEntryCoverImage(const GameList::Entry* entry)
|
|||
if (filename.isEmpty())
|
||||
return;
|
||||
|
||||
if (!GameList::GetCoverImagePathForEntry(entry).empty())
|
||||
const QString old_filename = QString::fromStdString(GameList::GetCoverImagePathForEntry(entry));
|
||||
if (!old_filename.isEmpty())
|
||||
{
|
||||
if (QMessageBox::question(this, tr("Cover Already Exists"),
|
||||
tr("A cover image for this game already exists, do you wish to replace it?"), QMessageBox::Yes,
|
||||
|
@ -2311,6 +2312,12 @@ void MainWindow::setGameListEntryCoverImage(const GameList::Entry* entry)
|
|||
return;
|
||||
}
|
||||
|
||||
if (!old_filename.isEmpty() && old_filename != new_filename && !QFile::remove(old_filename))
|
||||
{
|
||||
QMessageBox::critical(this, tr("Copy Error"), tr("Failed to remove '%1'").arg(old_filename));
|
||||
return;
|
||||
}
|
||||
|
||||
m_game_list_widget->refreshGridCovers();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue