summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2019-01-17 17:19:44 +0100
committerLioncash <mathew1800@gmail.com>2019-01-17 17:19:52 +0100
commita661025637f301013d9da781e67334853162c6b3 (patch)
tree5ff229c5ba29aef84c1e87f940952704aeae05b7 /src/core
parentyuzu/web_browser: std::move std::function instances in OpenPage() (diff)
downloadyuzu-a661025637f301013d9da781e67334853162c6b3.tar
yuzu-a661025637f301013d9da781e67334853162c6b3.tar.gz
yuzu-a661025637f301013d9da781e67334853162c6b3.tar.bz2
yuzu-a661025637f301013d9da781e67334853162c6b3.tar.lz
yuzu-a661025637f301013d9da781e67334853162c6b3.tar.xz
yuzu-a661025637f301013d9da781e67334853162c6b3.tar.zst
yuzu-a661025637f301013d9da781e67334853162c6b3.zip
Diffstat (limited to 'src/core')
-rw-r--r--src/core/core.cpp16
-rw-r--r--src/core/core.h13
-rw-r--r--src/core/frontend/applets/web_browser.cpp2
-rw-r--r--src/core/frontend/applets/web_browser.h4
-rw-r--r--src/core/hle/service/am/applets/web_browser.cpp2
5 files changed, 21 insertions, 16 deletions
diff --git a/src/core/core.cpp b/src/core/core.cpp
index 31c590866..572814e4b 100644
--- a/src/core/core.cpp
+++ b/src/core/core.cpp
@@ -443,27 +443,31 @@ std::shared_ptr<FileSys::VfsFilesystem> System::GetFilesystem() const {
return impl->virtual_filesystem;
}
-void System::SetProfileSelector(std::unique_ptr<Core::Frontend::ProfileSelectApplet> applet) {
+void System::SetProfileSelector(std::unique_ptr<Frontend::ProfileSelectApplet> applet) {
impl->profile_selector = std::move(applet);
}
-const Core::Frontend::ProfileSelectApplet& System::GetProfileSelector() const {
+const Frontend::ProfileSelectApplet& System::GetProfileSelector() const {
return *impl->profile_selector;
}
-void System::SetSoftwareKeyboard(std::unique_ptr<Core::Frontend::SoftwareKeyboardApplet> applet) {
+void System::SetSoftwareKeyboard(std::unique_ptr<Frontend::SoftwareKeyboardApplet> applet) {
impl->software_keyboard = std::move(applet);
}
-const Core::Frontend::SoftwareKeyboardApplet& System::GetSoftwareKeyboard() const {
+const Frontend::SoftwareKeyboardApplet& System::GetSoftwareKeyboard() const {
return *impl->software_keyboard;
}
-void System::SetWebBrowser(std::unique_ptr<Core::Frontend::WebBrowserApplet> applet) {
+void System::SetWebBrowser(std::unique_ptr<Frontend::WebBrowserApplet> applet) {
impl->web_browser = std::move(applet);
}
-const Core::Frontend::WebBrowserApplet& System::GetWebBrowser() const {
+Frontend::WebBrowserApplet& System::GetWebBrowser() {
+ return *impl->web_browser;
+}
+
+const Frontend::WebBrowserApplet& System::GetWebBrowser() const {
return *impl->web_browser;
}
diff --git a/src/core/core.h b/src/core/core.h
index a53dbb4d4..511a5ad3a 100644
--- a/src/core/core.h
+++ b/src/core/core.h
@@ -243,17 +243,18 @@ public:
std::shared_ptr<FileSys::VfsFilesystem> GetFilesystem() const;
- void SetProfileSelector(std::unique_ptr<Core::Frontend::ProfileSelectApplet> applet);
+ void SetProfileSelector(std::unique_ptr<Frontend::ProfileSelectApplet> applet);
- const Core::Frontend::ProfileSelectApplet& GetProfileSelector() const;
+ const Frontend::ProfileSelectApplet& GetProfileSelector() const;
- void SetSoftwareKeyboard(std::unique_ptr<Core::Frontend::SoftwareKeyboardApplet> applet);
+ void SetSoftwareKeyboard(std::unique_ptr<Frontend::SoftwareKeyboardApplet> applet);
- const Core::Frontend::SoftwareKeyboardApplet& GetSoftwareKeyboard() const;
+ const Frontend::SoftwareKeyboardApplet& GetSoftwareKeyboard() const;
- void SetWebBrowser(std::unique_ptr<Core::Frontend::WebBrowserApplet> applet);
+ void SetWebBrowser(std::unique_ptr<Frontend::WebBrowserApplet> applet);
- const Core::Frontend::WebBrowserApplet& GetWebBrowser() const;
+ Frontend::WebBrowserApplet& GetWebBrowser();
+ const Frontend::WebBrowserApplet& GetWebBrowser() const;
private:
System();
diff --git a/src/core/frontend/applets/web_browser.cpp b/src/core/frontend/applets/web_browser.cpp
index 6a36b4b8f..3a3d3d0bf 100644
--- a/src/core/frontend/applets/web_browser.cpp
+++ b/src/core/frontend/applets/web_browser.cpp
@@ -13,7 +13,7 @@ DefaultWebBrowserApplet::~DefaultWebBrowserApplet() = default;
void DefaultWebBrowserApplet::OpenPage(std::string_view filename,
std::function<void()> unpack_romfs_callback,
- std::function<void()> finished_callback) const {
+ std::function<void()> finished_callback) {
LOG_INFO(Service_AM,
"(STUBBED) called - No suitable web browser implementation found to open website page "
"at '{}'!",
diff --git a/src/core/frontend/applets/web_browser.h b/src/core/frontend/applets/web_browser.h
index 41d272d26..f952856af 100644
--- a/src/core/frontend/applets/web_browser.h
+++ b/src/core/frontend/applets/web_browser.h
@@ -14,7 +14,7 @@ public:
virtual ~WebBrowserApplet();
virtual void OpenPage(std::string_view url, std::function<void()> unpack_romfs_callback,
- std::function<void()> finished_callback) const = 0;
+ std::function<void()> finished_callback) = 0;
};
class DefaultWebBrowserApplet final : public WebBrowserApplet {
@@ -22,7 +22,7 @@ public:
~DefaultWebBrowserApplet() override;
void OpenPage(std::string_view url, std::function<void()> unpack_romfs_callback,
- std::function<void()> finished_callback) const override;
+ std::function<void()> finished_callback) override;
};
} // namespace Core::Frontend
diff --git a/src/core/hle/service/am/applets/web_browser.cpp b/src/core/hle/service/am/applets/web_browser.cpp
index d975207f5..ba2650e8b 100644
--- a/src/core/hle/service/am/applets/web_browser.cpp
+++ b/src/core/hle/service/am/applets/web_browser.cpp
@@ -146,7 +146,7 @@ void WebBrowser::Execute() {
return;
}
- const auto& frontend{Core::System::GetInstance().GetWebBrowser()};
+ auto& frontend{Core::System::GetInstance().GetWebBrowser()};
frontend.OpenPage(filename, [this] { UnpackRomFS(); }, [this] { Finalize(); });
}