MCPcopy Create free account
hub / github.com/altairwei/WizNotePlus / encryptDocument

Method encryptDocument

src/database/WizDatabase.cpp:4761–4787  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4759}
4760
4761bool 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
4789bool WizDatabase::compressFolderToZiwFile(WIZDOCUMENTDATA &document, \
4790 const QString& strFileFolder)

Callers 3

foreachFunction · 0.45

Calls 1

TOLOGFunction · 0.85

Tested by

no test coverage detected