Showing the changes to libraries/script-engine/src/FileScriptingInterface.cpp (1 of 4 files). Show all
Unified · Split
| @@ -51,18 +51,21 @@ void FileScriptingInterface::runUnzip(QString path, QUrl url, bool autoAdd, bool · 50 unmodified lines | ||
| 51 | 51 | return; |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | − QString file = unzipFile(path, tempDir); | |
| 55 | − qCDebug(scriptengine) << "Unzipped file: " << file; | |
| 56 | − QString filename = QUrl::fromLocalFile(file).toString(); | |
| 57 | − if (file != "") { | |
| 54 | + QStringList fileList = unzipFile(path, tempDir); | |
| 55 | + qCDebug(scriptengine) << "Unzipped file list: " << fileList; | |
| 56 | + QString filename = QUrl::fromLocalFile(fileList.first()).toString(); | |
| 57 | + | |
| 58 | + if (filename != "") { | |
| 58 | 59 | qCDebug(scriptengine) << "File to upload: " + filename; |
| 59 | − } else { | |
| 60 | + } | |
| 61 | + else { | |
| 60 | 62 | qCDebug(scriptengine) << "Unzip failed"; |
| 61 | 63 | } |
| 62 | − emit unzipResult(path, filename, autoAdd); | |
| 64 | + emit unzipResult(path, fileList, autoAdd, isBlocks); | |
| 65 | + | |
| 63 | 66 | } |
| 64 | 67 | |
| 65 | −QString FileScriptingInterface::unzipFile(QString path, QString tempDir) { | |
| 68 | +QStringList FileScriptingInterface::unzipFile(QString path, QString tempDir) { | |
| 66 | 69 | |
| 67 | 70 | QDir dir(path); |
| 68 | 71 | QString dirName = dir.path(); |
| @@ -73,11 +76,11 @@ QString FileScriptingInterface::unzipFile(QString path, QString tempDir) { · 4 unmodified lines | ||
| 73 | 76 | qCDebug(scriptengine) << list; |
| 74 | 77 | |
| 75 | 78 | if (!list.isEmpty()) { |
| 76 | − return list.front(); | |
| 79 | + return list; | |
| 77 | 80 | } |
| 78 | 81 | else { |
| 79 | 82 | qCDebug(scriptengine) << "Extraction failed"; |
| 80 | − return ""; | |
| 83 | + return list; | |
| 81 | 84 | } |
| 82 | 85 | |
| 83 | 86 | } |