From f8da99d212998dc2deb6b4ea2e05bb460502e6ad Mon Sep 17 00:00:00 2001 From: pineappleEA Date: Sun, 12 Sep 2021 23:31:31 +0200 Subject: [PATCH] early-access version 2051 --- README.md | 2 +- .../hle/service/filesystem/filesystem.cpp | 21 ++++++++++++------- src/yuzu/main.cpp | 20 ++++++++---------- 3 files changed, 23 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index d77a00357..3dea97fd3 100755 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ yuzu emulator early access ============= -This is the source code for early-access 2049. +This is the source code for early-access 2051. ## Legal Notice diff --git a/src/core/hle/service/filesystem/filesystem.cpp b/src/core/hle/service/filesystem/filesystem.cpp index 4a9b13e45..db17d61e4 100755 --- a/src/core/hle/service/filesystem/filesystem.cpp +++ b/src/core/hle/service/filesystem/filesystem.cpp @@ -97,14 +97,19 @@ ResultCode VfsDirectoryServiceWrapper::DeleteFile(const std::string& path_) cons ResultCode VfsDirectoryServiceWrapper::CreateDirectory(const std::string& path_) const { std::string path(Common::FS::SanitizePath(path_)); - auto dir = GetDirectoryRelativeWrapped(backing, Common::FS::GetParentPath(path)); - if (dir == nullptr || Common::FS::GetFilename(Common::FS::GetParentPath(path)).empty()) { - dir = backing; - } - auto new_dir = dir->CreateSubdirectory(Common::FS::GetFilename(path)); - if (new_dir == nullptr) { - // TODO(DarkLordZach): Find a better error code for this - return ResultUnknown; + const auto components = Common::FS::SplitPathComponents(path); + std::string relative_path; + for (const auto& component : components) { + // Skip empty path components + if (component.empty()) { + continue; + } + relative_path = Common::FS::SanitizePath(relative_path + '/' + component); + auto new_dir = backing->CreateSubdirectory(relative_path); + if (new_dir == nullptr) { + // TODO(DarkLordZach): Find a better error code for this + return ResultUnknown; + } } return ResultSuccess; } diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 35c3de8e9..3c2824362 100755 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -3240,12 +3240,11 @@ std::optional GMainWindow::SelectRomFSDumpTarget(const FileSys::ContentProv } bool GMainWindow::ConfirmClose() { - if (emu_thread == nullptr || !UISettings::values.confirm_before_closing) + if (emu_thread == nullptr || !UISettings::values.confirm_before_closing) { return true; - - QMessageBox::StandardButton answer = - QMessageBox::question(this, tr("yuzu"), tr("Are you sure you want to close yuzu?"), - QMessageBox::Yes | QMessageBox::No, QMessageBox::No); + } + const auto text = tr("Are you sure you want to close yuzu?"); + const auto answer = QMessageBox::question(this, tr("yuzu"), text); return answer != QMessageBox::No; } @@ -3327,14 +3326,13 @@ bool GMainWindow::ConfirmChangeGame() { } bool GMainWindow::ConfirmForceLockedExit() { - if (emu_thread == nullptr) + if (emu_thread == nullptr || !UISettings::values.confirm_before_closing) { return true; + } + const auto text = tr("The currently running application has requested yuzu to not exit.\n\n" + "Would you like to bypass this and exit anyway?"); - const auto answer = - QMessageBox::question(this, tr("yuzu"), - tr("The currently running application has requested yuzu to not " - "exit.\n\nWould you like to bypass this and exit anyway?"), - QMessageBox::Yes | QMessageBox::No, QMessageBox::No); + const auto answer = QMessageBox::question(this, tr("yuzu"), text); return answer != QMessageBox::No; }