GH-2384 Replace existing mod files

This commit is contained in:
janrupf 2018-11-08 18:14:20 +01:00 committed by Petr Mrázek
parent 3d630c7856
commit 16df8d7b88

View File

@ -146,6 +146,8 @@ bool SimpleModList::installMod(const QString &filename)
if (type == Mod::MOD_SINGLEFILE || type == Mod::MOD_ZIPFILE || type == Mod::MOD_LITEMOD) if (type == Mod::MOD_SINGLEFILE || type == Mod::MOD_ZIPFILE || type == Mod::MOD_LITEMOD)
{ {
QString newpath = FS::PathCombine(m_dir.path(), fileinfo.fileName()); QString newpath = FS::PathCombine(m_dir.path(), fileinfo.fileName());
if(QFile::exists(newpath))
QFile::remove(newpath);
if (!QFile::copy(fileinfo.filePath(), newpath)) if (!QFile::copy(fileinfo.filePath(), newpath))
return false; return false;
FS::updateTimestamp(newpath); FS::updateTimestamp(newpath);