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

Method writeNotes

xml/exportdata.cpp:502–600  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

500
501
502void ExportData::writeNotes() {
503 NoteTable table(global.db);
504 QList<qint32> dirtyLids;
505 table.getAllDirty(dirtyLids);
506 if (!cmdLine) {
507 progress->setMaximum(lids.size());
508 progress->setLabelText(tr("Notes"));
509 progress->setValue(0);
510 }
511 QCoreApplication::processEvents();
512
513 for (int i=0; i<lids.size() && !quitNow; i++) {
514 if (!cmdLine)
515 progress->setValue(i+1);
516 QCoreApplication::processEvents();
517 Note n;
518 table.get(n,lids[i], true,true);
519 writer->writeStartElement("Note");
520 if (n.guid.isSet())
521 createNode("Guid", n.guid);
522 if (n.title.isSet())
523 createNode("Title", n.title);
524 if (n.content.isSet()) {
525 writer->writeStartElement("Content");
526 writer->writeCDATA(n.content);
527 writer->writeEndElement();
528 }
529 if (n.contentHash.isSet())
530 createNode("ContentHash", n.contentHash);
531 if (n.contentLength.isSet())
532 createNode("ContentLength", n.contentLength);
533 if (n.created.isSet())
534 createTimestampNode("Created", n.created);
535 if (n.updated.isSet())
536 createTimestampNode("Updated", n.updated);
537 if (n.deleted.isSet())
538 createTimestampNode("Deleted", n.deleted);
539 if (n.active.isSet())
540 createNode("Active", n.active);
541 if (n.updateSequenceNum.isSet())
542 createNode("UpdateSequenceNumber", n.updateSequenceNum);
543 if (n.notebookGuid.isSet())
544 createNode("NotebookGuid", n.notebookGuid);
545 if (n.tagGuids.isSet() && n.tagNames.isSet() && n.tagNames.value().size() == n.tagGuids.value().size()) {
546 for (int j=0; j<n.tagGuids.value().size(); j++) {
547 writer->writeStartElement("Tag");
548 createNode("Guid", n.tagGuids.value()[j]);
549 createNode("Name", n.tagNames.value()[j]);
550 writer->writeEndElement();
551 }
552
553 }
554 if (n.resources.isSet()) {
555 for (int j=0; j<n.resources.value().size(); j++) {
556 writeResource(n.resources.value()[j]);
557 }
558 }
559 if (n.attributes.isSet()) {

Callers

nothing calls this directly

Calls 5

writeResourceFunction · 0.85
valueMethod · 0.80
getAllDirtyMethod · 0.45
getMethod · 0.45
isSetMethod · 0.45

Tested by

no test coverage detected