MCPcopy Create free account
hub / github.com/QNapi/qnapi / removeOrCopy

Method removeOrCopy

libqnapi/src/subtitlematcher.cpp:94–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

92}
93
94void 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
110bool SubtitleMatcher::dryCopy(QString srcFilePath, QString dstFilePath) const {
111 QFile dstFile(dstFilePath), srcFile(srcFilePath);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected