diff options
| author | Thomas Tanner <trtanner@btinternet.com> | 2015-12-15 15:58:01 +0000 |
|---|---|---|
| committer | Thomas Tanner <trtanner@btinternet.com> | 2015-12-15 15:58:01 +0000 |
| commit | 0c536a4c12e37caec2c3107875a97d5343c2a0a0 (patch) | |
| tree | cb2b7a908eb1c11d726b5d54926ac9638fa911af /src/transfersavesdialog.cpp | |
| parent | 967c2ae653b54bfc61c3854294f7b1cbff76809b (diff) | |
Makes iSaveGame responsible for returning all files involved in savegame.
Cleans up save deletion and save transfer dialogue somewhat
Diffstat (limited to 'src/transfersavesdialog.cpp')
| -rw-r--r-- | src/transfersavesdialog.cpp | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/src/transfersavesdialog.cpp b/src/transfersavesdialog.cpp index 710a33b9..b07a9510 100644 --- a/src/transfersavesdialog.cpp +++ b/src/transfersavesdialog.cpp @@ -71,6 +71,11 @@ public: return m_File;
}
+ virtual QStringList allFiles() const override
+ {
+ return { m_File };
+ }
+
private:
QString m_File;
};
@@ -298,19 +303,11 @@ bool TransferSavesDialog::transferCharacters(QString const &character, OverwriteMode overwriteMode = OVERWRITE_ASK;
- QStringList extensions = { m_GamePlugin->savegameExtension() };
- {
- ScriptExtender *ext = m_GamePlugin->feature<ScriptExtender>();
- if (ext != nullptr) {
- extensions += ext->saveGameAttachmentExtensions();
- }
- }
QDir destination(dest);
for (SaveListItem const &save : saves) {
- QFileInfo const saveFile = save->getFilename();
- for (QString const &ext : extensions) {
- QFileInfo sourceFile(saveFile.absoluteDir().absoluteFilePath(saveFile.completeBaseName() + "." + ext));
- QString destinationFile = destination.absoluteFilePath(sourceFile.fileName());
+ for (QString source : save->allFiles()) {
+ QFileInfo sourceFile(source);
+ QString destinationFile(destination.absoluteFilePath(sourceFile.fileName()));
//If the file is already there, let them skip (or not).
if (QFile::exists(destinationFile)) {
|
