Index: sources/device/DeviceController.cpp =================================================================== diff -u -ra7c580f0998ee781c47314384f677249cea4c4b4 -r1bf8c894c5cc5ea6d62af0662fcf5a18e1a06459 --- sources/device/DeviceController.cpp (.../DeviceController.cpp) (revision a7c580f0998ee781c47314384f677249cea4c4b4) +++ sources/device/DeviceController.cpp (.../DeviceController.cpp) (revision 1bf8c894c5cc5ea6d62af0662fcf5a18e1a06459) @@ -863,17 +863,18 @@ * \details The thread safe add file watch method * \param vFile - The file to add to watch. */ -void DeviceController::ondoAddWatch(const QString &vFile) +void DeviceController::ondoAddWatch(const QString &vFile, bool vCreate) { - if ( ! QFileInfo::exists(vFile)) { - if ( ! FileHandler::write(vFile, "", false) ) { // if the file doesn't exist it has to be created to be watched. - LOG_DEBUG(DeviceError::deviceErrorText(DeviceError::eDevice_Watch_Error_NotFound, 0)); - return; - } + 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) ) { - LOG_DEBUG(DeviceError::deviceErrorText(DeviceError::eDevice_Watch_Error_NotAdded, 0)); - } + if ( ! _fileSystemWatcher.addPath( vFile ) ) { err = DeviceError::eDevice_Watch_Error_NotAdded ; goto lErr; } + return; +lErr: + LOG_DEBUG(DeviceError::deviceErrorText(err, 0)); } /*! @@ -889,7 +890,7 @@ /*! * \brief DeviceController::onEventThreadChange * \details The signal handler for the DeviceController(this)::didEventThreadChange - * to start checking for the Encrypted partition readyness. + * to start checking for the Encrypted partition readiness. */ void DeviceController::onEventThreadChange() {