Delete temporary directory after content has been used

This commit is contained in:
David Rowe 2016-11-01 12:31:35 +13:00 committed by Seth Alves
parent 7e8fc12258
commit 0ccff32365
2 changed files with 9 additions and 2 deletions

View file

@ -5495,6 +5495,15 @@ void Application::addAssetToWorldUpload(QString path, QString mapping) {
} else {
addAssetToWorldSetMapping(mapping, hash);
}
// Remove temporary directory created by Clara.io market place download.
int index = path.lastIndexOf("/model_repo/");
if (index > 0) {
QString tempDir = path.left(index);
qCDebug(interfaceapp) << "Removing temporary directory at: " + tempDir;
QDir(tempDir).removeRecursively();
}
upload->deleteLater();
});

View file

@ -51,8 +51,6 @@ void FileScriptingInterface::runUnzip(QString path, QUrl url, bool autoAdd) {
} else {
qDebug() << "unzip failed";
}
qDebug() << "Removing temporary directory at: " + tempDir;
QDir(tempDir).removeRecursively();
}
// fix to check that we are only referring to a temporary directory