Index: sources/storage/FileHandler.cpp =================================================================== diff -u -r27cc308ff5113a9386899d3c8f8b29962a8498e1 -r3f60b9a1c0b3a43ec1c5c72955dce0d80354e35c --- sources/storage/FileHandler.cpp (.../FileHandler.cpp) (revision 27cc308ff5113a9386899d3c8f8b29962a8498e1) +++ sources/storage/FileHandler.cpp (.../FileHandler.cpp) (revision 3f60b9a1c0b3a43ec1c5c72955dce0d80354e35c) @@ -138,24 +138,64 @@ * \details Copies all the file and folders recursively. * \param vSource - The source folder * \param vDestination - The destination folder - * \return Tue on successful execution. + * \return True on successful execution. * \note This method uses the Linux "cp -r vSource vDestination" command * Not a Thread-Safe. - * */ -int FileHandler::copyFolder(const QString &vSource, const QString &vDestination ) +int FileHandler::copyFolder(const QString &vSource, const QString &vDestination) { // coco begin validated: This needs user interaction to export to USB device // has been tested manually since currently it is the only place it has been used. - QString cp = "cp"; + QString cmd = "cp"; QStringList arguments; arguments << "-r" << vSource << vDestination; - int result = QProcess::execute(cp, arguments); + int result = QProcess::execute(cmd, arguments); return result; } // coco end /*! + * \brief FileHandler::moveFolder + * \details Moves the source folder to destination. + * \param vFolder - The folder to be removed + * \return True on successful execution. + * \note This method uses the Linux "mv vSource vDestination" command + * Not a Thread-Safe. + */ +int FileHandler::moveFolder(const QString &vSource, const QString &vDestination) +{ + // coco begin validated: This needs user interaction to check the file system + // has been tested manually since currently it is the only place it has been used. + QString cmd = "mv"; + QStringList arguments; + arguments << vSource << vDestination; + int result = QProcess::execute(cmd, arguments); + return result; +} +// coco end + +/*! + * \brief FileHandler::removeFolder + * \details Removes the entire folder. + * \param vFolder - The folder + * \return True on successful execution. + * \note This method uses the Linux "rm -frd vSource vDestination" command + * <<<<< DANGEROUS BE CAREFUL >>>>> + * Not a Thread-Safe. + */ +int FileHandler::removeFolder(const QString &vFolder) +{ + // coco begin validated: This needs user interaction to check the file system + // has been tested manually since currently it is the only place it has been used. + QString cmd = "rm"; + QStringList arguments; + arguments << "-frd" << vFolder; + int result = QProcess::execute(cmd, arguments); + return result; +} +// coco end + +/*! * \brief FileHandler::removeFiles * \details * \param vFolder