Compare commits

...

1 Commits

Author SHA1 Message Date
Morph
50b7103723 main: Make use of unique_ptr for the QtSoftwareKeyboardDialog 2021-08-03 01:37:40 -04:00
2 changed files with 6 additions and 6 deletions

View File

@@ -468,12 +468,12 @@ void GMainWindow::SoftwareKeyboardInitialize(
return;
}
software_keyboard = new QtSoftwareKeyboardDialog(render_window, Core::System::GetInstance(),
is_inline, std::move(initialize_parameters));
software_keyboard = std::make_unique<QtSoftwareKeyboardDialog>(
render_window, Core::System::GetInstance(), is_inline, std::move(initialize_parameters));
if (is_inline) {
connect(
software_keyboard, &QtSoftwareKeyboardDialog::SubmitInlineText, this,
software_keyboard.get(), &QtSoftwareKeyboardDialog::SubmitInlineText, this,
[this](Service::AM::Applets::SwkbdReplyType reply_type, std::u16string submitted_text,
s32 cursor_position) {
emit SoftwareKeyboardSubmitInlineText(reply_type, submitted_text, cursor_position);
@@ -481,7 +481,7 @@ void GMainWindow::SoftwareKeyboardInitialize(
Qt::QueuedConnection);
} else {
connect(
software_keyboard, &QtSoftwareKeyboardDialog::SubmitNormalText, this,
software_keyboard.get(), &QtSoftwareKeyboardDialog::SubmitNormalText, this,
[this](Service::AM::Applets::SwkbdResult result, std::u16string submitted_text) {
emit SoftwareKeyboardSubmitNormalText(result, submitted_text);
},
@@ -566,7 +566,7 @@ void GMainWindow::SoftwareKeyboardExit() {
software_keyboard->ExitKeyboard();
software_keyboard = nullptr;
software_keyboard.reset();
}
void GMainWindow::WebBrowserOpenWebPage(const std::string& main_url,

View File

@@ -363,7 +363,7 @@ private:
bool disable_web_applet{};
// Applets
QtSoftwareKeyboardDialog* software_keyboard = nullptr;
std::unique_ptr<QtSoftwareKeyboardDialog> software_keyboard;
protected:
void dropEvent(QDropEvent* event) override;