MCPcopy Create free account
hub / github.com/baumgarr/nixnote2 / buildInkNote

Method buildInkNote

html/noteformatter.cpp:748–767  ·  view source on GitHub ↗

If we have an ink note, then we need to pull the image and display it */

Source from the content-addressed store, hash-verified

746
747/* If we have an ink note, then we need to pull the image and display it */
748bool NoteFormatter::buildInkNote(QWebElement &docElem, QString &hash) {
749 QLOG_TRACE_IN();
750
751 ResourceTable resTable(global.db);
752 qint32 resLid = resTable.getLidByHashHex(note.guid, hash);
753 if (resLid <= 0)
754 return false;
755 docElem.setAttribute("en-tag", "en-media");
756 docElem.setAttribute("lid", QString::number(resLid));
757 docElem.setAttribute("type", "application/vnd.evernote.ink");
758 QString filename = QString("file:///") +global.fileManager.getDbaDirPath()+QString::number(resLid)+QString(".png");
759 docElem.setAttribute("src", filename);
760 QString k = docElem.toOuterXml();
761 k.replace("<en-media", "<img");
762 k.replace("enmedia>", "img>");;
763 docElem.setOuterXml(k);
764
765 QLOG_TRACE_OUT();
766 return true;
767}
768
769
770

Callers

nothing calls this directly

Calls 4

getLidByHashHexMethod · 0.80
setAttributeMethod · 0.80
getDbaDirPathMethod · 0.80
QStringClass · 0.50

Tested by

no test coverage detected