| 4759 | } |
| 4760 | |
| 4761 | bool WizDatabase::encryptDocument(WIZDOCUMENTDATA& document) |
| 4762 | { |
| 4763 | if (document.nProtected || document.strKbGUID != kbGUID()) |
| 4764 | return false; |
| 4765 | |
| 4766 | // |
| 4767 | QString strFolder = Utils::WizPathResolve::tempDocumentFolder(document.strGUID); |
| 4768 | if (!extractZiwFileToFolder(document, strFolder)) |
| 4769 | { |
| 4770 | TOLOG("extract ziw file failed!"); |
| 4771 | return false; |
| 4772 | } |
| 4773 | // |
| 4774 | if (!initZiwReaderForEncryption()) |
| 4775 | return false; |
| 4776 | |
| 4777 | // |
| 4778 | document.nProtected = 1; |
| 4779 | QString strFileName = getDocumentFileName(document.strGUID); |
| 4780 | if (compressFolderToZiwFile(document, strFolder, strFileName)) |
| 4781 | { |
| 4782 | emit documentDataModified(document); |
| 4783 | return true; |
| 4784 | } |
| 4785 | |
| 4786 | return false; |
| 4787 | } |
| 4788 | |
| 4789 | bool WizDatabase::compressFolderToZiwFile(WIZDOCUMENTDATA &document, \ |
| 4790 | const QString& strFileFolder) |
no test coverage detected