From ef21bd6193e6d0bebe356dd3401dafcf064c3aa6 Mon Sep 17 00:00:00 2001 From: Jeremy Rimpo Date: Fri, 8 Dec 2017 02:42:34 -0600 Subject: Scan for and include script extender save files when transferring saves --- src/transfersavesdialog.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src') diff --git a/src/transfersavesdialog.cpp b/src/transfersavesdialog.cpp index e130b1ae..b8dda056 100644 --- a/src/transfersavesdialog.cpp +++ b/src/transfersavesdialog.cpp @@ -334,6 +334,26 @@ bool TransferSavesDialog::transferCharacters( sourceFile.absoluteFilePath().toUtf8().constData(), destinationFile.toUtf8().constData()); } + + QFileInfo sourceFileSE(sourceFile.absolutePath() + "/" + sourceFile.completeBaseName() + "." + m_GamePlugin->savegameSEExtension()); + if (sourceFileSE.exists()) { + QString destinationFileSE(destination.absoluteFilePath(sourceFileSE.fileName())); + + //If the file is already there, let them skip (or not). + if (QFile::exists(destinationFileSE)) { + if (!testOverwrite(overwriteMode, destinationFileSE)) { + continue; + } + //OK, they want to remove it. + QFile::remove(destinationFileSE); + } + + if (!method(sourceFileSE.absoluteFilePath(), destinationFileSE)) { + qCritical(errmsg, + sourceFileSE.absoluteFilePath().toUtf8().constData(), + destinationFileSE.toUtf8().constData()); + } + } } } return true; -- cgit v1.3.1