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 | return; | 51 | return; |
| 52 | } | 52 | } |
| 53 | 53 | ||
| 54 | QString file = unzipFile(path, tempDir); | 54 | QStringList fileList = unzipFile(path, tempDir); |
| 55 | qCDebug(scriptengine) << "Unzipped file: " << file; | 55 | qCDebug(scriptengine) << "Unzipped file list: " << fileList; |
| 56 | QString filename = QUrl::fromLocalFile(file).toString(); | 56 | QString filename = QUrl::fromLocalFile(fileList.first()).toString(); |
| 57 | if (file != "") { | 57 | |
| 58 | if (filename != "") { | ||
| 58 | qCDebug(scriptengine) << "File to upload: " + filename; | 59 | qCDebug(scriptengine) << "File to upload: " + filename; |
| 59 | } else { | 60 | } |
| 61 | else { | ||
| 60 | qCDebug(scriptengine) << "Unzip failed"; | 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 | QDir dir(path); | 70 | QDir dir(path); |
| 68 | QString dirName = dir.path(); | 71 | QString dirName = dir.path(); |
| @@ -73,11 +76,11 @@ QString FileScriptingInterface::unzipFile(QString path, QString tempDir) { · 4 unmodified lines | |||
| 73 | qCDebug(scriptengine) << list; | 76 | qCDebug(scriptengine) << list; |
| 74 | 77 | ||
| 75 | if (!list.isEmpty()) { | 78 | if (!list.isEmpty()) { |
| 76 | return list.front(); | 79 | return list; |
| 77 | } | 80 | } |
| 78 | else { | 81 | else { |
| 79 | qCDebug(scriptengine) << "Extraction failed"; | 82 | qCDebug(scriptengine) << "Extraction failed"; |
| 80 | return ""; | 83 | return list; |
| 81 | } | 84 | } |
| 82 | 85 | ||
| 83 | } | 86 | } |