summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Munro <brian.alexander.munro@gmail.com>2017-12-08 19:41:04 +0200
committerGitHub <noreply@github.com>2017-12-08 19:41:04 +0200
commit0aaece55d8b5bb392523db4ee96029d0567294e8 (patch)
treeb54e386cf49645dc5739c06c6c809ca4b80220c6
parent7c80181e010af25a2d1d0df12f4c715aa6a7bed9 (diff)
parentef21bd6193e6d0bebe356dd3401dafcf064c3aa6 (diff)
Merge pull request #138 from Silarn/mainline_dev
Fixes for local saves and configuration handling
-rw-r--r--src/modlist.cpp3
-rw-r--r--src/profile.cpp12
-rw-r--r--src/transfersavesdialog.cpp20
3 files changed, 22 insertions, 13 deletions
diff --git a/src/modlist.cpp b/src/modlist.cpp
index 081a5abf..53350c59 100644
--- a/src/modlist.cpp
+++ b/src/modlist.cpp
@@ -24,6 +24,7 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
#include "qtgroupingproxy.h"
#include "viewmarkingscrollbar.h"
#include "modlistsortproxy.h"
+#include "settings.h"
#include <appconfig.h>
#include <utility.h>
#include <report.h>
@@ -836,7 +837,7 @@ bool ModList::dropURLs(const QMimeData *mimeData, int row, const QModelIndex &pa
ModInfo::Ptr modInfo = ModInfo::getByIndex(row);
QDir modDirectory(modInfo->absolutePath());
- QDir gameDirectory(qApp->property("dataPath").toString() + "/" + QString::fromStdWString(AppConfig::overwritePath()));
+ QDir gameDirectory(Settings::instance().getOverwriteDirectory());
unsigned int overwriteIndex = ModInfo::findMod([] (ModInfo::Ptr mod) -> bool {
std::vector<ModInfo::EFlag> flags = mod->getFlags();
diff --git a/src/profile.cpp b/src/profile.cpp
index 558d9114..6382a15c 100644
--- a/src/profile.cpp
+++ b/src/profile.cpp
@@ -221,18 +221,6 @@ void Profile::createTweakedIniFile()
error = true;
}
- if (localSavesEnabled()) {
- if (!::WritePrivateProfileStringW(L"General", L"bUseMyGamesDirectory", L"0", ToWString(tweakedIni).c_str())) {
- error = true;
- }
-
- if (!::WritePrivateProfileStringW(L"General", L"SLocalSavePath",
- AppConfig::localSavePlaceholder(),
- ToWString(tweakedIni).c_str())) {
- error = true;
- }
- }
-
if (error) {
reportError(tr("failed to create tweaked ini: %1").arg(getCurrentErrorStringA().c_str()));
}
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;