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

Method reviewCurrentNote

src/gui/documentviewer/WizDocumentView.cpp:542–577  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

540}
541
542void WizDocumentView::reviewCurrentNote()
543{
544 Q_ASSERT(!m_note.strGUID.isEmpty());
545
546 initStat(m_note, m_editorMode == modeEditor);
547
548 // download document if not exist
549 WizDatabase& db = m_dbMgr.db(m_note.strKbGUID);
550 QString strDocumentFileName = db.getDocumentFileName(m_note.strGUID);
551 if (!db.isObjectDataDownloaded(m_note.strGUID, "document") || \
552 !WizPathFileExists(strDocumentFileName))
553 {
554 downloadNoteFromServer(m_note);
555
556 return;
557 }
558
559 // ask user cipher if needed
560 if (m_note.nProtected) {
561 if(!db.loadUserCert()) {
562 return;
563 }
564
565 if (db.getCertPassword().isEmpty()) {
566 m_passwordView->setHint(db.getCertPasswordHint());
567 m_stack->setCurrentWidget(m_passwordView);
568 m_passwordView->setCipherEditorFocus();
569
570 return;
571 }
572 }
573
574 if (m_stack->currentWidget() != m_docView) {
575 m_stack->setCurrentWidget(m_docView);
576 }
577}
578
579/*!
580 Set the \a mode of editor and try to save document before switching mode.

Callers 1

viewDocumentMethod · 0.80

Calls 9

WizPathFileExistsFunction · 0.85
isEmptyMethod · 0.80
getDocumentFileNameMethod · 0.80
loadUserCertMethod · 0.80
getCertPasswordMethod · 0.80
setHintMethod · 0.80
getCertPasswordHintMethod · 0.80
setCipherEditorFocusMethod · 0.80

Tested by

no test coverage detected