From 51862e862dd353e746913c989a6fce87ecbc7a5c Mon Sep 17 00:00:00 2001
From: Paulo Alfaiate <syl.paulo.alfaiate@gmail.com>
Date: Thu, 7 Mar 2024 22:39:17 +0000
Subject: [PATCH] Removed RomFSRawCopy + VfsDirectoryCreateFileWrapper obsolete
 functions

---
 src/common/settings.h |  2 +-
 src/yuzu/main.cpp     | 70 -------------------------------------------
 2 files changed, 1 insertion(+), 71 deletions(-)

diff --git a/src/common/settings.h b/src/common/settings.h
index dad57e4210..57e1ad7f2a 100644
--- a/src/common/settings.h
+++ b/src/common/settings.h
@@ -612,7 +612,7 @@ struct Values {
 
     // WebService
     Setting<bool> enable_telemetry{linkage, false, "enable_telemetry", Category::WebService};
-    Setting<std::string> web_api_url{linkage, "https://api.yuzu-emu.org", "web_api_url",
+    Setting<std::string> web_api_url{linkage, "https://api.suyu.dev", "web_api_url",
                                      Category::WebService};
     Setting<std::string> yuzu_username{linkage, std::string(), "yuzu_username",
                                        Category::WebService};
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp
index 4797adf895..63994424e5 100644
--- a/src/yuzu/main.cpp
+++ b/src/yuzu/main.cpp
@@ -54,14 +54,6 @@
 #include "yuzu/multiplayer/state.h"
 #include "yuzu/util/controller_navigation.h"
 
-// These are wrappers to avoid the calls to CreateFile because of the Windows
-// defines.
-
-static FileSys::VirtualFile VfsDirectoryCreateFileWrapper(const FileSys::VirtualDir& dir,
-                                                          const std::string& path) {
-    return dir->CreateFile(path);
-}
-
 #include <fmt/ostream.h>
 #include <glad/glad.h>
 
@@ -2374,68 +2366,6 @@ void GMainWindow::OnTransferableShaderCacheOpenFile(u64 program_id) {
     QDesktopServices::openUrl(QUrl::fromLocalFile(qt_shader_cache_path));
 }
 
-static bool RomFSRawCopy(size_t total_size, size_t& read_size, QProgressDialog& dialog,
-                         const FileSys::VirtualDir& src, const FileSys::VirtualDir& dest,
-                         bool full) {
-    if (src == nullptr || dest == nullptr || !src->IsReadable() || !dest->IsWritable())
-        return false;
-    if (dialog.wasCanceled())
-        return false;
-
-    std::vector<u8> buffer(CopyBufferSize);
-    auto last_timestamp = std::chrono::steady_clock::now();
-
-    const auto QtRawCopy = [&](const FileSys::VirtualFile& src_file,
-                               const FileSys::VirtualFile& dest_file) {
-        if (src_file == nullptr || dest_file == nullptr) {
-            return false;
-        }
-        if (!dest_file->Resize(src_file->GetSize())) {
-            return false;
-        }
-
-        for (std::size_t i = 0; i < src_file->GetSize(); i += buffer.size()) {
-            if (dialog.wasCanceled()) {
-                dest_file->Resize(0);
-                return false;
-            }
-
-            using namespace std::literals::chrono_literals;
-            const auto new_timestamp = std::chrono::steady_clock::now();
-
-            if ((new_timestamp - last_timestamp) > 33ms) {
-                last_timestamp = new_timestamp;
-                dialog.setValue(
-                    static_cast<int>(std::min(read_size, total_size) * 100 / total_size));
-                QCoreApplication::processEvents();
-            }
-
-            const auto read = src_file->Read(buffer.data(), buffer.size(), i);
-            dest_file->Write(buffer.data(), read, i);
-
-            read_size += read;
-        }
-
-        return true;
-    };
-
-    if (full) {
-        for (const auto& file : src->GetFiles()) {
-            const auto out = VfsDirectoryCreateFileWrapper(dest, file->GetName());
-            if (!QtRawCopy(file, out))
-                return false;
-        }
-    }
-
-    for (const auto& dir : src->GetSubdirectories()) {
-        const auto out = dest->CreateSubdirectory(dir->GetName());
-        if (!RomFSRawCopy(total_size, read_size, dialog, dir, out, full))
-            return false;
-    }
-
-    return true;
-}
-
 QString GMainWindow::GetGameListErrorRemoving(InstalledEntryType type) const {
     switch (type) {
     case InstalledEntryType::Game:
-- 
GitLab