Index: sources/device/DeviceController.cpp =================================================================== diff -u -r95d717f975007dad9c7ab1450863b1dfdf627790 -r146db65b27df897c06dba90f24e6ac0f4f132456 --- sources/device/DeviceController.cpp (.../DeviceController.cpp) (revision 95d717f975007dad9c7ab1450863b1dfdf627790) +++ sources/device/DeviceController.cpp (.../DeviceController.cpp) (revision 146db65b27df897c06dba90f24e6ac0f4f132456) @@ -879,11 +879,12 @@ { DeviceError::Scripts_Error_Enum err = DeviceError::eDevice_OK; if ( vCreate ) { - if ( ! FileHandler::write( vFile, "", false) ) { err = DeviceError::eDevice_Watch_Error_NotCreate; goto lErr; } - } else { - if ( ! QFileInfo::exists ( vFile ) ) { err = DeviceError::eDevice_Watch_Error_NotFound ; goto lErr; } - } - if ( ! _fileSystemWatcher.addPath( vFile ) ) { err = DeviceError::eDevice_Watch_Error_NotAdded ; goto lErr; } + if ( ! FileHandler::write ( vFile, "", false) ) { err = DeviceError::eDevice_Watch_Error_NotCreate; goto lErr; }} + else { + if ( ! QFileInfo::exists ( vFile ) ) { err = DeviceError::eDevice_Watch_Error_NotFound ; goto lErr; }} + if ( ! _fileSystemWatcher.removePath ( vFile ) ) { LOG_APPED_UI(QString("Device NOT watching %1").arg(vFile)); } + else { LOG_APPED_UI(QString("Device watch removed %1").arg(vFile)); } + if ( ! _fileSystemWatcher.addPath ( vFile ) ) { err = DeviceError::eDevice_Watch_Error_NotAdded ; goto lErr; } LOG_APPED_UI(QString("Device watch %1").arg(vFile)); return;