Index: sources/device/DeviceController.cpp =================================================================== diff -u -r80b5e8f1ebb90c03c37d90d90cd2da3bd95d6803 -r61f87c52ccba9ce140fd8039915e025b6c790575 --- sources/device/DeviceController.cpp (.../DeviceController.cpp) (revision 80b5e8f1ebb90c03c37d90d90cd2da3bd95d6803) +++ sources/device/DeviceController.cpp (.../DeviceController.cpp) (revision 61f87c52ccba9ce140fd8039915e025b6c790575) @@ -107,6 +107,8 @@ connect(&_fileSystemWatcher , SIGNAL( fileChanged(const QString &)), this , SLOT( onWatchFileChanged(const QString &))); + connect(&_fileSystemWatcher , SIGNAL( directoryChanged(const QString &)), + this , SLOT( onWatchDirectoryChanged(const QString &))); connect(&_ApplicationController , SIGNAL(didPOSTEthernetData (const QString &)), this , SLOT( onPOSTEthernetData (const QString &))); @@ -777,6 +779,23 @@ } /*! + * \brief DeviceController::ondoAddDirWatch + * \details The thread safe add directory watch method + * \param vDirectory - The folder to add to watch. + */ +void DeviceController::ondoAddDirectoryWatch(const QString &vDirectory) +{ + QDir directory(vDirectory); + if ( !directory.exists()) { + LOG_DEBUG(DeviceError::deviceErrorText(DeviceError::eDevice_Watch_Error_NotFound, 0)); + return; + } + if ( ! _fileSystemWatcher.addPath(vDirectory) ) { + LOG_DEBUG(DeviceError::deviceErrorText(DeviceError::eDevice_Watch_Error_NotAdded, 0)); + } +} + +/*! * \brief DeviceController::onWatchFileChanged * \details This slot is called once the files being watched is updated. * \param vFile - the file name. @@ -787,6 +806,16 @@ } /*! + * \brief DeviceController::onWatchDirectoryChanged + * \details This slot is called once the folders being watched is updated. + * \param vDirectory - the name of the directory + */ +void DeviceController::onWatchDirectoryChanged(const QString &vDirectory) +{ + emit didWatchDirectoryChange(vDirectory); +} + +/*! * \brief DeviceController::onEventThreadChange * \details The signal handler for the DeviceController(this)::didEventThreadChange * to start checking for the Encrypted partition readyness.