Copy the `fileName` from `src` to `dst`. This function overwrites if the file already exists in the destination.
| 57 | /// Copy the `fileName` from `src` to `dst`. |
| 58 | /// This function overwrites if the file already exists in the destination. |
| 59 | bool migrateFile(const QString &fileName, const QDir &src, const QDir &dst) { |
| 60 | QString srcFile = src.filePath(fileName); |
| 61 | QString dstFile = dst.filePath(fileName); |
| 62 | |
| 63 | if(QFile::exists(srcFile) && QFile::exists(dstFile)) { |
| 64 | QFile::remove(dstFile); |
| 65 | } |
| 66 | |
| 67 | return QFile::copy(srcFile, dstFile); |
| 68 | } |