| 494 | } |
| 495 | |
| 496 | bool 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 | |
| 526 | bool WizDocument::copyTo(WizDatabase& targetDB, const WIZTAGDATA& targetTag, |
| 527 | bool keepDocTime) |
no test coverage detected