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

Method updateDocumentDataWithFolder

src/database/WizDatabase.cpp:3512–3537  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3510
3511
3512bool WizDatabase::updateDocumentDataWithFolder(WIZDOCUMENTDATA& data,
3513 const QString& strFolder,
3514 bool notifyDataModify /*= true*/)
3515{
3516 CString strZipFileName = getDocumentFileName(data.strGUID);
3517 if (!data.nProtected) {
3518 bool bZip = ::WizFolder2Zip(strFolder, strZipFileName);
3519 if (!bZip) {
3520 return false;
3521 }
3522 } else {
3523 CString strTempFile = Utils::WizPathResolve::tempPath() + data.strGUID + "-decrypted";
3524 bool bZip = ::WizFolder2Zip(strFolder, strTempFile);
3525 if (!bZip) {
3526 return false;
3527 }
3528
3529 if (!m_ziwReader->encryptFileToFile(strTempFile, strZipFileName)) {
3530 return false;
3531 }
3532 }
3533
3534 setObjectDataDownloaded(data.strGUID, "document", true);
3535
3536 return updateDocumentDataMD5(data, strZipFileName, notifyDataModify);
3537}
3538
3539void WizDatabase::clearUnusedImages(const QString& strHtml, const QString& strFilePath)
3540{

Callers 1

Calls 2

WizFolder2ZipFunction · 0.85
encryptFileToFileMethod · 0.80

Tested by

no test coverage detected