Showing the changes to libraries/script-engine/src/FileScriptingInterface.cpp (1 of 4 files). Show all
Unified · Split
| @@ -68,6 +68,10 @@ void FileScriptingInterface::runUnzip(QString path, QUrl url, bool autoAdd, bool · 67 unmodified lines | |||
| 68 | if (path.contains("vr.google.com/downloads")) { | 68 | if (path.contains("vr.google.com/downloads")) { |
| 69 | isZip = true; | 69 | isZip = true; |
| 70 | } | 70 | } |
| 71 | if (!hasModel(fileList)) { | ||
| 72 | isZip = false; | ||
| 73 | } | ||
| 74 | |||
| 71 | emit unzipResult(path, fileList, autoAdd, isZip, isBlocks); | 75 | emit unzipResult(path, fileList, autoAdd, isZip, isBlocks); |
| 72 | 76 | ||
| 73 | } | 77 | } |
| @@ -107,6 +111,15 @@ bool FileScriptingInterface::isTempDir(QString tempDir) { · 33 unmodified lines | |||
| 107 | return (testContainer == tempContainer); | 111 | return (testContainer == tempContainer); |
| 108 | } | 112 | } |
| 109 | 113 | ||
| 114 | bool FileScriptingInterface::hasModel(QStringList fileList) { | ||
| 115 | for (int i = 0; i < fileList.size(); i++) { | ||
| 116 | if (fileList.at(i).toLower().contains(".fbx") || fileList.at(i).toLower().contains(".obj")) { | ||
| 117 | return true; | ||
| 118 | } | ||
| 119 | } | ||
| 120 | return false; | ||
| 121 | } | ||
| 122 | |||
| 110 | QString FileScriptingInterface::getTempDir() { | 123 | QString FileScriptingInterface::getTempDir() { |
| 111 | QTemporaryDir dir; | 124 | QTemporaryDir dir; |
| 112 | dir.setAutoRemove(false); | 125 | dir.setAutoRemove(false); |