aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--launcher/FileSystem.cpp26
-rw-r--r--launcher/FileSystem.h3
-rw-r--r--launcher/modplatform/flame/FlameInstanceCreationTask.cpp2
-rw-r--r--launcher/modplatform/modpacksch/FTBPackInstallTask.cpp2
4 files changed, 2 insertions, 31 deletions
diff --git a/launcher/FileSystem.cpp b/launcher/FileSystem.cpp
index 508da08d..bf0849ec 100644
--- a/launcher/FileSystem.cpp
+++ b/launcher/FileSystem.cpp
@@ -163,32 +163,6 @@ bool ensureFolderPathExists(QString foldernamepath)
return success;
}
-/// @brief Copy file at src to dest, ensures the full filepath exsists
-/// @param src srouce file path
-/// @param dst destination file path
-/// @return boolean: was there an error during the filecopy?
-bool copyFile(QString const& src, QString const& dst) {
- using copy_opts = fs::copy_options;
-
- std::error_code err;
-
- fs::copy_options opt = copy_opts::none;
- // The default behavior is to follow symlinks
- opt |= copy_opts::copy_symlinks;
-
- ensureFilePathExists(dst);
-
- fs::copy(toStdString(src), toStdString(dst), opt, err);
- if (err) {
- qWarning() << "Failed to copy files:" << QString::fromStdString(err.message());
- qDebug() << "Source file:" << src;
- qDebug() << "Destination file:" << dst;
- }
-
- return err.value() == 0;
-
-}
-
/// @brief Copies a directory and it's contents from src to dest
/// @param offset subdirectory form src to copy to dest
/// @return if there was an error during the filecopy
diff --git a/launcher/FileSystem.h b/launcher/FileSystem.h
index 11981f68..b7e175fd 100644
--- a/launcher/FileSystem.h
+++ b/launcher/FileSystem.h
@@ -75,9 +75,6 @@ bool ensureFilePathExists(QString filenamepath);
*/
bool ensureFolderPathExists(QString filenamepath);
-// TODO: remove in favor of FS::copy once #333 is merged
-bool copyFile(QString const& src, QString const& dst);
-
/// @brief Copies a directory and it's contents from src to dest
class copy {
public:
diff --git a/launcher/modplatform/flame/FlameInstanceCreationTask.cpp b/launcher/modplatform/flame/FlameInstanceCreationTask.cpp
index 30438a1a..5d4dc689 100644
--- a/launcher/modplatform/flame/FlameInstanceCreationTask.cpp
+++ b/launcher/modplatform/flame/FlameInstanceCreationTask.cpp
@@ -433,7 +433,7 @@ void FlameCreationTask::copyBlockedMods(QList<BlockedMod> const& blocked_mods) {
qDebug() << "Will try to copy" << mod.localPath << "to" << dest_path;
- if (!FS::copyFile(mod.localPath, dest_path)) { // FIXME: use FS::copy once #333 is merged
+ if (!FS::copy(mod.localPath, dest_path)()) {
qDebug() << "Copy of" << mod.localPath << "to" << dest_path << "Failed";
}
diff --git a/launcher/modplatform/modpacksch/FTBPackInstallTask.cpp b/launcher/modplatform/modpacksch/FTBPackInstallTask.cpp
index 06ef1deb..1e4bbe19 100644
--- a/launcher/modplatform/modpacksch/FTBPackInstallTask.cpp
+++ b/launcher/modplatform/modpacksch/FTBPackInstallTask.cpp
@@ -373,7 +373,7 @@ void PackInstallTask::copyBlockedMods() {
qDebug() << "Will try to copy" << mod->localPath << "to" << dest_path;
- if (!FS::copyFile(mod->localPath, dest_path)) { // FIXME: use FS::copy once #333 is merged
+ if (!FS::copy(mod->localPath, dest_path)()) {
qDebug() << "Copy of" << mod->localPath << "to" << dest_path << "Failed";
}