|
|
@@ -1,6 +1,5 @@
|
|
|
#include <QListWidgetItem>
|
|
|
#include <QMessageBox>
|
|
|
-#include <QDir>
|
|
|
#include "ui_ConflictModal.h"
|
|
|
#include "conflictModal.h"
|
|
|
#include "ConflictItemWidget.h"
|
|
|
@@ -8,7 +7,7 @@
|
|
|
|
|
|
using namespace craftlab::fakeraid;
|
|
|
|
|
|
-std::string mergePath(const std::string& a, const QChar& separator, const std::string& b);
|
|
|
+std::string mergePath(const std::string& a, const std::string& b);
|
|
|
|
|
|
ConflictModal::ConflictModal(const std::vector<std::string>& _rootPaths, const DiffResult& _diffResult): rootPaths(_rootPaths), diffResult(std::make_unique<DiffResult>(_diffResult)), ui(std::make_unique<Ui_ConflictModal>())
|
|
|
{
|
|
|
@@ -72,19 +71,19 @@ void ConflictModal::ComputeRemovalProcess(const std::string& filename)
|
|
|
{
|
|
|
for (int i = 0; i < differentFilesIter->second.size(); ++i)
|
|
|
if (differentFilesIter->second[i] > 0)
|
|
|
- processItems.filesToRemove.push_back(mergePath(rootPaths[i], QDir::separator(), filename));
|
|
|
+ processItems.filesToRemove.push_back(mergePath(rootPaths[i], filename));
|
|
|
}
|
|
|
else if (missingFilesIter != diffResult->missingFiles.end())
|
|
|
{
|
|
|
for (int i = 0; i < missingFilesIter->second.size(); ++i)
|
|
|
if (!missingFilesIter->second[i])
|
|
|
- processItems.filesToRemove.push_back(mergePath(rootPaths[i], QDir::separator(), filename));
|
|
|
+ processItems.filesToRemove.push_back(mergePath(rootPaths[i], filename));
|
|
|
}
|
|
|
else if (missingDirsIter != diffResult->missingDirs.end())
|
|
|
{
|
|
|
for (int i = 0; i < missingDirsIter->second.size(); ++i)
|
|
|
if (!missingDirsIter->second[i])
|
|
|
- processItems.dirsToRemove.push_back(mergePath(rootPaths[i], QDir::separator(), filename));
|
|
|
+ processItems.dirsToRemove.push_back(mergePath(rootPaths[i], filename));
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -93,10 +92,10 @@ void ConflictModal::ComputeCopyProcess(const std::string& filename, const std::v
|
|
|
assert(versionToUse >= 0);
|
|
|
assert(std::find(foundVersions.begin(), foundVersions.end(), versionToUse) != foundVersions.end());
|
|
|
|
|
|
- const std::string sourcePath = mergePath(rootPaths[std::distance(foundVersions.begin(), std::find(foundVersions.begin(), foundVersions.end(), versionToUse))], QDir::separator(), filename);
|
|
|
+ const std::string sourcePath = mergePath(rootPaths[std::distance(foundVersions.begin(), std::find(foundVersions.begin(), foundVersions.end(), versionToUse))], filename);
|
|
|
for (int i = 0; i < foundVersions.size(); ++i)
|
|
|
if (foundVersions[i] != versionToUse)
|
|
|
- processItems.itemsToCopy.push_back(IEngine::CopyInstruction(sourcePath, mergePath(rootPaths[i], QDir::separator(), filename)));
|
|
|
+ processItems.itemsToCopy.push_back(IEngine::CopyInstruction(sourcePath, mergePath(rootPaths[i], filename)));
|
|
|
}
|
|
|
|
|
|
DiffResult ConflictModal::ComputeOutcome(const std::vector<std::string>& rootPaths)
|