mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 20:23:06 +02:00
use a copy of filename in Recording.cpp to make changes to filename
This commit is contained in:
parent
2ee367fa44
commit
93d83b707d
1 changed files with 9 additions and 8 deletions
|
@ -781,17 +781,18 @@ RecordingPointer readRecordingFromRecFile(RecordingPointer recording, const QStr
|
||||||
qDebug() << "Read " << byteArray.size() << " bytes in " << timer.elapsed() << " ms.";
|
qDebug() << "Read " << byteArray.size() << " bytes in " << timer.elapsed() << " ms.";
|
||||||
|
|
||||||
// Set new filename
|
// Set new filename
|
||||||
if (filename.startsWith("http") || filename.startsWith("https") || filename.startsWith("ftp")) {
|
QString newFilename = filename;
|
||||||
filename = QUrl(filename).fileName();
|
if (newFilename.startsWith("http") || newFilename.startsWith("https") || newFilename.startsWith("ftp")) {
|
||||||
|
newFilename = QUrl(newFilename).fileName();
|
||||||
}
|
}
|
||||||
if (filename.endsWith(".rec") || filename.endsWith(".REC")) {
|
if (newFilename.endsWith(".rec") || newFilename.endsWith(".REC")) {
|
||||||
filename.chop(qstrlen(".rec"));
|
newFilename.chop(qstrlen(".rec"));
|
||||||
}
|
}
|
||||||
filename.append(".hfr");
|
newFilename.append(".hfr");
|
||||||
filename = QFileInfo(filename).absoluteFilePath();
|
newFilename = QFileInfo(newFilename).absoluteFilePath();
|
||||||
|
|
||||||
// Set recording to new format
|
// Set recording to new format
|
||||||
writeRecordingToFile(recording, filename);
|
writeRecordingToFile(recording, newFilename);
|
||||||
qDebug() << "Recording has been successfully converted at" << filename;
|
qDebug() << "Recording has been successfully converted at" << newFilename;
|
||||||
return recording;
|
return recording;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue