Showing the changes to libraries/script-engine/src/FileScriptingInterface.cpp (1 of 5 files). Show all
Unified · Split
| @@ -31,9 +31,13 @@ FileScriptingInterface::FileScriptingInterface(QObject* parent) : QObject(parent · 30 unmodified lines | ||
| 31 | 31 | // nothing for now |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | −void FileScriptingInterface::runUnzip(QString path, QString tempDir, QUrl url) { | |
| 34 | +void FileScriptingInterface::runUnzip(QString path, QUrl url) { | |
| 35 | 35 | qDebug() << "Url that was downloaded: " + url.toString(); |
| 36 | 36 | qDebug() << "Path where download is saved: " + path; |
| 37 | + QString fileName = "/" + path.section("/", -1); | |
| 38 | + qDebug() << "Filename to remove from temp path: " + fileName; | |
| 39 | + QString tempDir = path.remove(fileName); | |
| 40 | + qDebug() << "Temporary directory at: " + tempDir; | |
| 37 | 41 | QString file = unzipFile(path, tempDir); |
| 38 | 42 | if (file != "") { |
| 39 | 43 | qDebug() << "file to upload: " + file; |
| @@ -47,7 +51,7 @@ void FileScriptingInterface::runUnzip(QString path, QString tempDir, QUrl url) { · 7 unmodified lines | ||
| 47 | 51 | QDir(tempDir).removeRecursively(); |
| 48 | 52 | } |
| 49 | 53 | |
| 50 | −bool FileScriptingInterface::testUrl(QUrl url) { | |
| 54 | +bool FileScriptingInterface::isZippedFbx(QUrl url) { | |
| 51 | 55 | if (url.toString().contains(".zip") && url.toString().contains("fbx")) return true; |
| 52 | 56 | qDebug() << "This model is not a .fbx packaged in a .zip. Please try with another model."; |
| 53 | 57 | return false; |