Skip to content

Commit

Permalink
ussdiface: fix the incorrect use of indexOfMethod()
Browse files Browse the repository at this point in the history
The argument of indexOfMethod() is supposed to be normallized [1]. The
"const &" shouldn't be around the QString type. Having one make Qt fails
to find the method, always triggering the error code.

It has always been incorrect, but it doesn't cause a problem because the
error handling was incorrect. Commit fc1e09e ("fix error handling
logic") fixes it, thus exposing this problem.

Fixes HelloVolla/ubuntu-touch-beta-tests#38
Should also fixes the problem on PinePhone as it uses the same code, but
I can't find the filed issue.

[1] https://doc.qt.io/qt-5/qmetaobject.html#indexOfMethod

Acked-by: Alexey Andreyev <[email protected]>
  • Loading branch information
peat-psuwit authored and a-andreyev committed Feb 12, 2021
1 parent 8be54bb commit b9bfed4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ussdiface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ ConnectionInterfaceUSSDAdaptor::~ConnectionInterfaceUSSDAdaptor()

void ConnectionInterfaceUSSDAdaptor::Initiate(const QString &command, const QDBusMessage& dbusMessage)
{
if (adaptee()->metaObject()->indexOfMethod("initiate(const QString &,ConnectionInterfaceUSSDAdaptor::InitiateContextPtr)") == -1) {
if (adaptee()->metaObject()->indexOfMethod("initiate(QString,ConnectionInterfaceUSSDAdaptor::InitiateContextPtr)") == -1) {
dbusConnection().send(dbusMessage.createErrorReply(TP_QT_ERROR_NOT_IMPLEMENTED, QLatin1String("Not implemented")));
return;
}
Expand Down

0 comments on commit b9bfed4

Please sign in to comment.