mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 06:44: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.";
|
||||
|
||||
// Set new filename
|
||||
if (filename.startsWith("http") || filename.startsWith("https") || filename.startsWith("ftp")) {
|
||||
filename = QUrl(filename).fileName();
|
||||
QString newFilename = filename;
|
||||
if (newFilename.startsWith("http") || newFilename.startsWith("https") || newFilename.startsWith("ftp")) {
|
||||
newFilename = QUrl(newFilename).fileName();
|
||||
}
|
||||
if (filename.endsWith(".rec") || filename.endsWith(".REC")) {
|
||||
filename.chop(qstrlen(".rec"));
|
||||
if (newFilename.endsWith(".rec") || newFilename.endsWith(".REC")) {
|
||||
newFilename.chop(qstrlen(".rec"));
|
||||
}
|
||||
filename.append(".hfr");
|
||||
filename = QFileInfo(filename).absoluteFilePath();
|
||||
newFilename.append(".hfr");
|
||||
newFilename = QFileInfo(newFilename).absoluteFilePath();
|
||||
|
||||
// Set recording to new format
|
||||
writeRecordingToFile(recording, filename);
|
||||
qDebug() << "Recording has been successfully converted at" << filename;
|
||||
writeRecordingToFile(recording, newFilename);
|
||||
qDebug() << "Recording has been successfully converted at" << newFilename;
|
||||
return recording;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue