Move parts of MappingCommon out of DolphinQt

Some of the functions in MappingCommon would be useful to use on
mobile in the future.
This commit is contained in:
JosJuice
2022-02-20 18:32:39 +01:00
parent 9af9e791f6
commit 1bc057614e
8 changed files with 204 additions and 154 deletions

View File

@ -34,6 +34,7 @@
#include "InputCommon/ControlReference/ExpressionParser.h"
#include "InputCommon/ControllerEmu/ControllerEmu.h"
#include "InputCommon/ControllerInterface/ControllerInterface.h"
#include "InputCommon/ControllerInterface/MappingCommon.h"
constexpr int SLIDER_TICK_COUNT = 100;
@ -485,9 +486,10 @@ void IOWindow::AppendSelectedOption()
if (m_option_list->currentRow() < 0)
return;
m_expression_text->insertPlainText(MappingCommon::GetExpressionForControl(
m_option_list->item(m_option_list->currentRow(), 0)->text(), m_devq,
m_controller->GetDefaultDevice()));
m_expression_text->insertPlainText(
QString::fromStdString(ciface::MappingCommon::GetExpressionForControl(
m_option_list->item(m_option_list->currentRow(), 0)->text().toStdString(), m_devq,
m_controller->GetDefaultDevice())));
}
void IOWindow::OnDeviceChanged()
@ -526,7 +528,7 @@ void IOWindow::OnDetectButtonPressed()
{
const auto expression =
MappingCommon::DetectExpression(m_detect_button, g_controller_interface, {m_devq.ToString()},
m_devq, MappingCommon::Quote::Off);
m_devq, ciface::MappingCommon::Quote::Off);
if (expression.isEmpty())
return;