Browse Source

InputComponent: log if slot invocation failed

Instead of silently ignoring it.
Vincent Lang 7 years ago
parent
commit
1bf4e4f1e7
1 changed files with 5 additions and 2 deletions
  1. 5 2
      src/input/InputComponent.cpp

+ 5 - 2
src/input/InputComponent.cpp

@@ -131,8 +131,11 @@ void InputComponent::handleAction(const QString& action)
           if (recvSlot->m_hasArguments)
             arg0 = Q_ARG(const QString&, hostArguments);
 
-          QMetaObject::invokeMethod(recvSlot->m_receiver, recvSlot->m_slot.data(),
-                                    Qt::AutoConnection, arg0);
+          if (!QMetaObject::invokeMethod(recvSlot->m_receiver, recvSlot->m_slot.data(),
+                                         Qt::AutoConnection, arg0))
+          {
+            QLOG_ERROR() << "Invoking slot" << qPrintable(recvSlot->m_slot.data()) << "failed!";
+          }
         }
       }
     }