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

Method copyTo

src/database/WizDatabase.cpp:496–524  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

494}
495
496bool WizDocument::copyTo(WizDatabase& targetDB, WizFolder* pFolder, bool keepDocTime,
497 bool keepDocTag, QString& newDocGUID)
498{
499 qDebug() << "wizdocu copy to : " << pFolder->location();
500 QString strLocation = pFolder->location();
501 WIZTAGDATA tagEmpty;
502 if (!copyDocumentTo(m_data.strGUID, targetDB, strLocation, tagEmpty, newDocGUID, keepDocTime))
503 {
504 TOLOG1("Failed to copy document %1.", m_data.strTitle);
505 return false;
506 }
507
508 if (keepDocTag && !m_db.isGroup() && m_db.kbGUID() == targetDB.kbGUID())
509 {
510 WIZDOCUMENTDATA newDoc;
511 if (!targetDB.documentFromGuid(newDocGUID, newDoc))
512 return false;
513
514 CWizStdStringArray arrayTag;
515 if (m_db.getDocumentTags(m_data.strGUID, arrayTag))
516 {
517 for (CString tagGUID : arrayTag)
518 {
519 targetDB.insertDocumentTag(newDoc, tagGUID);
520 }
521 }
522 }
523 return true;
524}
525
526bool WizDocument::copyTo(WizDatabase& targetDB, const WIZTAGDATA& targetTag,
527 bool keepDocTime)

Callers 2

Calls 7

getDocumentTagsMethod · 0.80
insertDocumentTagMethod · 0.80
locationMethod · 0.45
isGroupMethod · 0.45
kbGUIDMethod · 0.45
documentFromGuidMethod · 0.45

Tested by

no test coverage detected