| 92 | } |
| 93 | |
| 94 | void SubtitleMatcher::removeOrCopy(QString targetMoviefilePath, |
| 95 | QString targetSubtitlesFilePath) const { |
| 96 | if (QFile::exists(targetSubtitlesFilePath)) { |
| 97 | if (!noBackup) { |
| 98 | QFileInfo targetSubtitlesFileInfo(targetSubtitlesFilePath); |
| 99 | QString newName = constructSubtitlePath( |
| 100 | targetMoviefilePath, targetSubtitlesFileInfo.suffix(), tr("_copy")); |
| 101 | |
| 102 | if (QFile::exists(newName)) QFile::remove(newName); |
| 103 | |
| 104 | QFile::rename(targetSubtitlesFilePath, newName); |
| 105 | } else |
| 106 | QFile::remove(targetSubtitlesFilePath); |
| 107 | } |
| 108 | } |
| 109 | |
| 110 | bool SubtitleMatcher::dryCopy(QString srcFilePath, QString dstFilePath) const { |
| 111 | QFile dstFile(dstFilePath), srcFile(srcFilePath); |
nothing calls this directly
no outgoing calls
no test coverage detected