GH-2384 Replace existing mod files
This commit is contained in:
parent
3d630c7856
commit
16df8d7b88
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user