Index: sources/device/DeviceGlobals.h =================================================================== diff -u -r0932b2beee9cc169291cbf69161f902f805237b1 -r574c7c5fb48b1fcb72337f5fb4c0119a20288815 --- sources/device/DeviceGlobals.h (.../DeviceGlobals.h) (revision 0932b2beee9cc169291cbf69161f902f805237b1) +++ sources/device/DeviceGlobals.h (.../DeviceGlobals.h) (revision 574c7c5fb48b1fcb72337f5fb4c0119a20288815) @@ -94,26 +94,27 @@ * to start the corresponding process and call the script assigned to it. \ */ \ void onAttributeRequest (const Device##vATTRIBUTEFLC##RequestData &vData); \ + private : \ /*! \ * \brief DeviceController::onProcessExitCode \ * \details The slot which is being called once the started process is returning a value \ * as an exit code, probably from within the called script \ * \param vExitCode - the returned exit code \ * \param vStatus - the status of the process \ */ \ - void onProcess##vATTRIBUTEFLC##ExitCode(int vExitCode, QProcess::ExitStatus vStatus); \ - void onProcess##vATTRIBUTEFLC##ReadyOut(); \ - void onProcess##vATTRIBUTEFLC##ReadyErr(); \ - private : + void process##vATTRIBUTEFLC##Response(int vExitCode, QProcess::ExitStatus vStatus, \ + QProcess::ProcessChannel vChannel ); \ + void process##vATTRIBUTEFLC##ReadyOut(); \ + void process##vATTRIBUTEFLC##ReadyErr(); \ #define DEVICE_DEV_DECLARATION( vATTRIBUTEFLC ) \ - void DeviceController::onProcess##vATTRIBUTEFLC##ReadyOut() { \ + void DeviceController::process##vATTRIBUTEFLC##ReadyOut() { \ M##Device##vATTRIBUTEFLC##Response model; \ model._data.mAccepted = false; \ model._data.mMessage = _process##vATTRIBUTEFLC.readAllStandardOutput(); \ emit didAttributeResponse(model.data()); \ } \ - void DeviceController::onProcess##vATTRIBUTEFLC##ReadyErr() { \ + void DeviceController::process##vATTRIBUTEFLC##ReadyErr() { \ M##Device##vATTRIBUTEFLC##Response model; \ model._data.mAccepted = false; \ model._data.mMessage = QString("Err:") + _process##vATTRIBUTEFLC.readAllStandardError(); \ @@ -124,12 +125,18 @@ /* App -> Dev //TODO: Add the error LOG connection */ \ connect(&_ApplicationController , SIGNAL(didAttributeRequest(const Device##vATTRIBUTEFLC##RequestData &)), \ this , SLOT( onAttributeRequest(const Device##vATTRIBUTEFLC##RequestData &))); \ - connect(&_process##vATTRIBUTEFLC, SIGNAL( finished(int, QProcess::ExitStatus)), \ - this, SLOT(onProcess##vATTRIBUTEFLC##ExitCode(int, QProcess::ExitStatus))); \ - connect(&_process##vATTRIBUTEFLC, SIGNAL( readyReadStandardOutput( )), \ - this, SLOT(onProcess##vATTRIBUTEFLC##ReadyOut( ))); \ - connect(&_process##vATTRIBUTEFLC, SIGNAL( readyReadStandardError ( )), \ - this, SLOT(onProcess##vATTRIBUTEFLC##ReadyErr( ))); \ + connect(&_process##vATTRIBUTEFLC, QOverload::of(&QProcess::finished), \ + this , [=](int vExitCode, QProcess::ExitStatus vStatus) { \ + process##vATTRIBUTEFLC##Response(vExitCode, vStatus , QProcess::StandardOutput ); \ + }); \ + connect(&_process##vATTRIBUTEFLC, &QProcess::readyReadStandardOutput, \ + this , [=]( ) { \ + process##vATTRIBUTEFLC##Response(-1, QProcess::NormalExit, QProcess::StandardOutput ); \ + }); \ + connect(&_process##vATTRIBUTEFLC, &QProcess::readyReadStandardError , \ + this , [=]( ) { \ + process##vATTRIBUTEFLC##Response(-1, QProcess::NormalExit, QProcess::StandardError ); \ + }); \ /* ---------------------------- APP */ #define DEVICE_APP_BRIDGE_DEFINITION( vATTRIBUTEFLC ) \