Browse Source

Avoid back and forth string conversions

adaptive-webui-19844
Chocobo1 5 years ago
parent
commit
a3ca277eaf
No known key found for this signature in database
GPG Key ID: 210D9C873253A68C
  1. 4
      src/webui/api/apicontroller.cpp

4
src/webui/api/apicontroller.cpp

@ -45,8 +45,8 @@ QVariant APIController::run(const QString &action, const StringMap &params, cons @@ -45,8 +45,8 @@ QVariant APIController::run(const QString &action, const StringMap &params, cons
m_params = params;
m_data = data;
const QString methodName {action + QLatin1String("Action")};
if (!QMetaObject::invokeMethod(this, methodName.toLatin1().constData()))
const QByteArray methodName = action.toLatin1() + "Action";
if (!QMetaObject::invokeMethod(this, methodName.constData()))
throw APIError(APIErrorType::NotFound);
return m_result;

Loading…
Cancel
Save