core: Eliminate more uses of Core::System::GetInstance(). (#7313)
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
|
||||
namespace Frontend {
|
||||
void RegisterDefaultApplets(Core::System& system) {
|
||||
system.RegisterSoftwareKeyboard(std::make_shared<DefaultKeyboard>());
|
||||
system.RegisterSoftwareKeyboard(std::make_shared<DefaultKeyboard>(system));
|
||||
system.RegisterMiiSelector(std::make_shared<DefaultMiiSelector>());
|
||||
}
|
||||
} // namespace Frontend
|
||||
|
||||
@@ -144,10 +144,12 @@ const KeyboardData& SoftwareKeyboard::ReceiveData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
DefaultKeyboard::DefaultKeyboard(Core::System& system_) : system(system_) {}
|
||||
|
||||
void DefaultKeyboard::Execute(const Frontend::KeyboardConfig& config_) {
|
||||
SoftwareKeyboard::Execute(config_);
|
||||
|
||||
auto cfg = Service::CFG::GetModule(Core::System::GetInstance());
|
||||
auto cfg = Service::CFG::GetModule(system);
|
||||
std::string username = Common::UTF16ToUTF8(cfg->GetUsername());
|
||||
switch (this->config.button_config) {
|
||||
case ButtonConfig::None:
|
||||
|
||||
@@ -8,6 +8,10 @@
|
||||
#include <vector>
|
||||
#include "common/assert.h"
|
||||
|
||||
namespace Core {
|
||||
class System;
|
||||
}
|
||||
|
||||
namespace Frontend {
|
||||
|
||||
enum class AcceptedInput {
|
||||
@@ -137,8 +141,12 @@ protected:
|
||||
|
||||
class DefaultKeyboard final : public SoftwareKeyboard {
|
||||
public:
|
||||
explicit DefaultKeyboard(Core::System& system_);
|
||||
void Execute(const KeyboardConfig& config) override;
|
||||
void ShowError(const std::string& error) override;
|
||||
|
||||
private:
|
||||
Core::System& system;
|
||||
};
|
||||
|
||||
} // namespace Frontend
|
||||
|
||||
Reference in New Issue
Block a user