MCPcopy Create free account
hub / github.com/NatronGitHub/Natron / nextBackup

Function nextBackup

Engine/Project.cpp:532–543  ·  view source on GitHub ↗

if filePath matches .*\.~[0-9]+~, increment the backup number else append .~1~

Source from the content-addressed store, hash-verified

530// if filePath matches .*\.~[0-9]+~, increment the backup number
531// else append .~1~
532static QString
533nextBackup(const QString & filePath)
534{
535 QRegExp rx(QString::fromUtf8("\\.~(\\d+)~$"));
536 int pos = rx.lastIndexIn(filePath);
537 if (pos >= 0) {
538 int i = rx.cap(1).toInt();
539 return filePath.left(pos) + QString::fromUtf8(".~%1~").arg(i+1);
540 } else {
541 return filePath + QString::fromUtf8(".~1~");
542 }
543}
544
545QString
546Project::saveProjectInternal(const QString & path,

Callers 1

saveProjectInternalMethod · 0.85

Calls 1

leftMethod · 0.45

Tested by

no test coverage detected