History

Making JS/QML safer (DOES NOT WORK)

elisa-lj11 committed 10 years ago

Commit 9ea9bae1 parent b8f5a9d5 files · +13 −8Browse files

Showing the changes to libraries/script-engine/src/FileScriptingInterface.cpp (1 of 5 files). Show all

Unified · Split

libraries/script-engine/src/FileScriptingInterface.cpp+6−2
@@ -31,9 +31,13 @@ FileScriptingInterface::FileScriptingInterface(QObject* parent) : QObject(parent · 30 unmodified lines
3131 // nothing for now
3232 }
3333
34−void FileScriptingInterface::runUnzip(QString path, QString tempDir, QUrl url) {
34+void FileScriptingInterface::runUnzip(QString path, QUrl url) {
3535 qDebug() << "Url that was downloaded: " + url.toString();
3636 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;
3741 QString file = unzipFile(path, tempDir);
3842 if (file != "") {
3943 qDebug() << "file to upload: " + file;
@@ -47,7 +51,7 @@ void FileScriptingInterface::runUnzip(QString path, QString tempDir, QUrl url) { · 7 unmodified lines
4751 QDir(tempDir).removeRecursively();
4852 }
4953
50−bool FileScriptingInterface::testUrl(QUrl url) {
54+bool FileScriptingInterface::isZippedFbx(QUrl url) {
5155 if (url.toString().contains(".zip") && url.toString().contains("fbx")) return true;
5256 qDebug() << "This model is not a .fbx packaged in a .zip. Please try with another model.";
5357 return false;