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

Method trySaveDocument

src/gui/documentviewer/WizDocumentWebView.cpp:1586–1605  ·  view source on GitHub ↗

* @brief save note * @param data note data * @param force save force * @param callback callback if fail */

Source from the content-addressed store, hash-verified

1584 * @param callback callback if fail
1585 */
1586void WizDocumentWebView::trySaveDocument(const WIZDOCUMENTDATA& data, bool force, std::function<void(const QVariant &)> callback)
1587{
1588 if (!view()->noteLoaded()) //encrypting note & has been loaded
1589 {
1590 // callback after fail
1591 callback(QVariant(false));
1592 return;
1593 }
1594
1595 if (m_currentEditorMode == modeEditor)
1596 {
1597 // save note under editable pattern
1598 saveEditingViewDocument(data, force, callback);
1599 }
1600 else
1601 {
1602 // save note under read pattern
1603 saveReadingViewDocument(data, force, callback);
1604 }
1605}
1606
1607void WizDocumentWebView::editorCommandQueryCommandValue(const QString& strCommand, std::function<void(const QString& value)> callback)
1608{

Callers 6

trySaveCurrentNoteMethod · 0.45
waitForDoneMethod · 0.45
waitForSaveMethod · 0.45
viewNoteMethod · 0.45

Calls 1

noteLoadedMethod · 0.80

Tested by

no test coverage detected