diff options
Diffstat (limited to '')
-rw-r--r-- | src/core/file_sys/errors.h | 1 | ||||
-rw-r--r-- | src/core/frontend/applets/web_browser.cpp | 4 | ||||
-rw-r--r-- | src/core/frontend/applets/web_browser.h | 9 | ||||
-rw-r--r-- | src/core/hle/service/filesystem/filesystem.cpp | 9 | ||||
-rw-r--r-- | src/core/hle/service/hid/controllers/gesture.cpp | 2 | ||||
-rw-r--r-- | src/core/hle/service/hid/controllers/touchscreen.cpp | 2 |
6 files changed, 17 insertions, 10 deletions
diff --git a/src/core/file_sys/errors.h b/src/core/file_sys/errors.h index bb4654366..1a920b45d 100644 --- a/src/core/file_sys/errors.h +++ b/src/core/file_sys/errors.h @@ -9,6 +9,7 @@ namespace FileSys { constexpr ResultCode ERROR_PATH_NOT_FOUND{ErrorModule::FS, 1}; +constexpr ResultCode ERROR_PATH_ALREADY_EXISTS{ErrorModule::FS, 2}; constexpr ResultCode ERROR_ENTITY_NOT_FOUND{ErrorModule::FS, 1002}; constexpr ResultCode ERROR_SD_CARD_NOT_FOUND{ErrorModule::FS, 2001}; constexpr ResultCode ERROR_OUT_OF_BOUNDS{ErrorModule::FS, 3005}; diff --git a/src/core/frontend/applets/web_browser.cpp b/src/core/frontend/applets/web_browser.cpp index 50db6a654..be4736f47 100644 --- a/src/core/frontend/applets/web_browser.cpp +++ b/src/core/frontend/applets/web_browser.cpp @@ -12,7 +12,7 @@ WebBrowserApplet::~WebBrowserApplet() = default; DefaultWebBrowserApplet::~DefaultWebBrowserApplet() = default; void DefaultWebBrowserApplet::OpenLocalWebPage( - std::string_view local_url, std::function<void()> extract_romfs_callback, + const std::string& local_url, std::function<void()> extract_romfs_callback, std::function<void(Service::AM::Applets::WebExitReason, std::string)> callback) const { LOG_WARNING(Service_AM, "(STUBBED) called, backend requested to open local web page at {}", local_url); @@ -21,7 +21,7 @@ void DefaultWebBrowserApplet::OpenLocalWebPage( } void DefaultWebBrowserApplet::OpenExternalWebPage( - std::string_view external_url, + const std::string& external_url, std::function<void(Service::AM::Applets::WebExitReason, std::string)> callback) const { LOG_WARNING(Service_AM, "(STUBBED) called, backend requested to open external web page at {}", external_url); diff --git a/src/core/frontend/applets/web_browser.h b/src/core/frontend/applets/web_browser.h index 1c5ef19a9..d7bd44c27 100644 --- a/src/core/frontend/applets/web_browser.h +++ b/src/core/frontend/applets/web_browser.h @@ -16,11 +16,11 @@ public: virtual ~WebBrowserApplet(); virtual void OpenLocalWebPage( - std::string_view local_url, std::function<void()> extract_romfs_callback, + const std::string& local_url, std::function<void()> extract_romfs_callback, std::function<void(Service::AM::Applets::WebExitReason, std::string)> callback) const = 0; virtual void OpenExternalWebPage( - std::string_view external_url, + const std::string& external_url, std::function<void(Service::AM::Applets::WebExitReason, std::string)> callback) const = 0; }; @@ -28,11 +28,12 @@ class DefaultWebBrowserApplet final : public WebBrowserApplet { public: ~DefaultWebBrowserApplet() override; - void OpenLocalWebPage(std::string_view local_url, std::function<void()> extract_romfs_callback, + void OpenLocalWebPage(const std::string& local_url, + std::function<void()> extract_romfs_callback, std::function<void(Service::AM::Applets::WebExitReason, std::string)> callback) const override; - void OpenExternalWebPage(std::string_view external_url, + void OpenExternalWebPage(const std::string& external_url, std::function<void(Service::AM::Applets::WebExitReason, std::string)> callback) const override; }; diff --git a/src/core/hle/service/filesystem/filesystem.cpp b/src/core/hle/service/filesystem/filesystem.cpp index 72ad273b2..67b2b3102 100644 --- a/src/core/hle/service/filesystem/filesystem.cpp +++ b/src/core/hle/service/filesystem/filesystem.cpp @@ -55,10 +55,15 @@ std::string VfsDirectoryServiceWrapper::GetName() const { ResultCode VfsDirectoryServiceWrapper::CreateFile(const std::string& path_, u64 size) const { std::string path(Common::FS::SanitizePath(path_)); auto dir = GetDirectoryRelativeWrapped(backing, Common::FS::GetParentPath(path)); - // dir can be nullptr if path contains subdirectories, create those prior to creating the file. if (dir == nullptr) { - dir = backing->CreateSubdirectory(Common::FS::GetParentPath(path)); + return FileSys::ERROR_PATH_NOT_FOUND; + } + + const auto entry_type = GetEntryType(path); + if (entry_type.Code() == RESULT_SUCCESS) { + return FileSys::ERROR_PATH_ALREADY_EXISTS; } + auto file = dir->CreateFile(Common::FS::GetFilename(path)); if (file == nullptr) { // TODO(DarkLordZach): Find a better error code for this diff --git a/src/core/hle/service/hid/controllers/gesture.cpp b/src/core/hle/service/hid/controllers/gesture.cpp index 155808f6a..71545bf1f 100644 --- a/src/core/hle/service/hid/controllers/gesture.cpp +++ b/src/core/hle/service/hid/controllers/gesture.cpp @@ -33,7 +33,7 @@ void Controller_Gesture::OnUpdate(const Core::Timing::CoreTiming& core_timing, u shared_memory.header.timestamp = core_timing.GetCPUTicks(); shared_memory.header.total_entry_count = 17; - if (!IsControllerActivated()) { + if (!IsControllerActivated() || !Settings::values.touchscreen.enabled) { shared_memory.header.entry_count = 0; shared_memory.header.last_entry_index = 0; return; diff --git a/src/core/hle/service/hid/controllers/touchscreen.cpp b/src/core/hle/service/hid/controllers/touchscreen.cpp index b5f8077be..8f56a0255 100644 --- a/src/core/hle/service/hid/controllers/touchscreen.cpp +++ b/src/core/hle/service/hid/controllers/touchscreen.cpp @@ -33,7 +33,7 @@ void Controller_Touchscreen::OnUpdate(const Core::Timing::CoreTiming& core_timin shared_memory.header.timestamp = core_timing.GetCPUTicks(); shared_memory.header.total_entry_count = 17; - if (!IsControllerActivated()) { + if (!IsControllerActivated() || !Settings::values.touchscreen.enabled) { shared_memory.header.entry_count = 0; shared_memory.header.last_entry_index = 0; return; |