aboutsummaryrefslogtreecommitdiff
path: root/launcher/FileSystem.cpp
diff options
context:
space:
mode:
authorSefa Eyeoglu <contact@scrumplex.net>2023-07-05 19:26:07 +0200
committerGitHub <noreply@github.com>2023-07-05 19:26:07 +0200
commit5ba13297c6295acf76e69fe1b3cf7723b9d2ad05 (patch)
treefca95df01afdfe81a8bfec2ef9fedb21548eb58a /launcher/FileSystem.cpp
parent7c8a010378a6b49e80861936106a497f4fa0ad96 (diff)
parent00be211169134022813562cd09c69f831d0e400e (diff)
downloadPrismLauncher-5ba13297c6295acf76e69fe1b3cf7723b9d2ad05.tar.gz
PrismLauncher-5ba13297c6295acf76e69fe1b3cf7723b9d2ad05.tar.bz2
PrismLauncher-5ba13297c6295acf76e69fe1b3cf7723b9d2ad05.zip
Merge pull request #1284 from Ryex/fix/properly-track-failed-copies-and-clones
Diffstat (limited to 'launcher/FileSystem.cpp')
-rw-r--r--launcher/FileSystem.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/launcher/FileSystem.cpp b/launcher/FileSystem.cpp
index 3ce8dd2c..812d45eb 100644
--- a/launcher/FileSystem.cpp
+++ b/launcher/FileSystem.cpp
@@ -36,6 +36,7 @@
*/
#include "FileSystem.h"
+#include <QPair>
#include "BuildConfig.h"
@@ -246,6 +247,7 @@ bool copy::operator()(const QString& offset, bool dryRun)
{
using copy_opts = fs::copy_options;
m_copied = 0; // reset counter
+ m_failedPaths.clear();
// NOTE always deep copy on windows. the alternatives are too messy.
#if defined Q_OS_WIN32
@@ -277,6 +279,9 @@ bool copy::operator()(const QString& offset, bool dryRun)
qWarning() << "Failed to copy files:" << QString::fromStdString(err.message());
qDebug() << "Source file:" << src_path;
qDebug() << "Destination file:" << dst_path;
+ m_failedPaths.append(dst_path);
+ emit copyFailed(relative_dst_path);
+ return;
}
m_copied++;
emit fileCopied(relative_dst_path);
@@ -1077,6 +1082,7 @@ bool clone::operator()(const QString& offset, bool dryRun)
}
m_cloned = 0; // reset counter
+ m_failedClones.clear();
auto src = PathCombine(m_src.absolutePath(), offset);
auto dst = PathCombine(m_dst.absolutePath(), offset);
@@ -1097,6 +1103,9 @@ bool clone::operator()(const QString& offset, bool dryRun)
qDebug() << "Failed to clone files: error" << err.value() << "message" << QString::fromStdString(err.message());
qDebug() << "Source file:" << src_path;
qDebug() << "Destination file:" << dst_path;
+ m_failedClones.append(qMakePair(src_path, dst_path));
+ emit cloneFailed(src_path, dst_path);
+ return;
}
m_cloned++;
emit fileCloned(src_path, dst_path);