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

Ensure we have a writable storage folder for imported documents

parent 6c5c58af
......@@ -1324,6 +1324,21 @@ void KdenliveDoc::loadDocumentProperties()
QDir dir(path);
m_projectFolder = dir.absolutePath();
bool ok;
// Ensure document storage folder is writable
QString documentId = QDir::cleanPath(getDocumentProperty(QStringLiteral("documentid")));
documentId.toLongLong(&ok, 10);
if (ok) {
if (!dir.exists(documentId)) {
if (!dir.mkpath(documentId)) {
// Invalid storage folder, reset to default
} else {
// Something is wrong, documentid not readable
qDebug()<<"=========\n\nCannot read document id: "<<documentId<<"\n\n==========";
QString profile = m_documentProperties.value(QStringLiteral("profile"));
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