| 38 | } |
| 39 | |
| 40 | bool writeSupportBundleZip(const QString& sourceDir, const QString& archivePath) |
| 41 | { |
| 42 | const QList<ZipEntryData> entries = collectSupportBundleEntries(sourceDir); |
| 43 | if (entries.isEmpty()) |
| 44 | return false; |
| 45 | |
| 46 | // Deflate: support bundles are log-dominated and compress ~5-10x (#3218). |
| 47 | const QByteArray zip = writeDeflatedZip(entries); |
| 48 | if (zip.isEmpty()) |
| 49 | return false; |
| 50 | |
| 51 | QSaveFile archive(archivePath); |
| 52 | if (!archive.open(QIODevice::WriteOnly)) |
| 53 | return false; |
| 54 | if (archive.write(zip) != zip.size()) |
| 55 | return false; |
| 56 | return archive.commit(); |
| 57 | } |
| 58 | |
| 59 | } // namespace |
| 60 |
no test coverage detected