| 5295 | } |
| 5296 | |
| 5297 | Document::OpenResult Document::openDocumentArchive(const QString &docFile, const QUrl &url, const QString &password) |
| 5298 | { |
| 5299 | d->m_archiveData = DocumentPrivate::unpackDocumentArchive(docFile); |
| 5300 | if (!d->m_archiveData) { |
| 5301 | return OpenError; |
| 5302 | } |
| 5303 | |
| 5304 | const QString tempFileName = d->m_archiveData->document.fileName(); |
| 5305 | QMimeDatabase db; |
| 5306 | const QMimeType docMime = db.mimeTypeForFile(tempFileName, QMimeDatabase::MatchExtension); |
| 5307 | const OpenResult ret = openDocument(tempFileName, url, docMime, password); |
| 5308 | |
| 5309 | if (ret != OpenSuccess) { |
| 5310 | delete d->m_archiveData; |
| 5311 | d->m_archiveData = nullptr; |
| 5312 | } |
| 5313 | |
| 5314 | return ret; |
| 5315 | } |
| 5316 | |
| 5317 | bool Document::saveDocumentArchive(const QString &fileName) |
| 5318 | { |