Commit 50296316 authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Fix another possible corruption when relocating project folder

parent fd4cad47
......@@ -75,11 +75,14 @@ bool DocumentChecker::hasErrorInClips()
if (!dir.exists()) {
// Looks like project was moved, try recovering root from current project url
m_rootReplacement.first = dir.absolutePath() + QDir::separator();
root = m_url.adjusted(QUrl::RemoveFilename).toLocalFile();
root = m_url.adjusted(QUrl::RemoveFilename | QUrl::StripTrailingSlash).toLocalFile();
baseElement.setAttribute(QStringLiteral("root"), root);
root = QDir::cleanPath(root) + QDir::separator();
m_rootReplacement.second = root;
}
root = QDir::cleanPath(root) + QDir::separator();
else {
root = QDir::cleanPath(root) + QDir::separator();
}
}
// Check if strorage folder for temp files exists
QString storageFolder;
......
......@@ -65,7 +65,7 @@ bool DocumentValidator::validate(const double currentVersion)
if (rootDir == QLatin1String("$CURRENTPATH")) {
// The document was extracted from a Kdenlive archived project, fix root directory
QString playlist = m_doc.toString();
playlist.replace(QLatin1String("$CURRENTPATH"), m_url.adjusted(QUrl::RemoveFilename).path());
playlist.replace(QLatin1String("$CURRENTPATH"), m_url.adjusted(QUrl::RemoveFilename).toLocalFile());
m_doc.setContent(playlist);
mlt = m_doc.firstChildElement(QStringLiteral("mlt"));
kdenliveDoc = mlt.firstChildElement(QStringLiteral("kdenlivedoc"));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment