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

Method setNote

gui/browserWidgets/dateeditor.cpp:67–94  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65}
66
67void DateEditor::setNote(qint32 lid, Note n) {
68 createdDate.setNote(lid, n.created, NOTE_CREATED_DATE);
69 updatedDate.setNote(lid, n.updated, NOTE_UPDATED_DATE);
70 NoteAttributes attributes;
71 if (n.attributes.isSet())
72 attributes = n.attributes;
73 if (attributes.subjectDate.isSet() && attributes.subjectDate > 0)
74 subjectDate.setNote(lid, attributes.subjectDate, NOTE_ATTRIBUTE_SUBJECT_DATE);
75 else
76 subjectDate.setNote(lid, n.updated, NOTE_ATTRIBUTE_SUBJECT_DATE);
77
78 QString author;
79 if (attributes.author.isSet())
80 author = attributes.author;
81 authorEditor.setAuthor(lid, author.trimmed());
82
83 double longitude=0, altitude=0, latitude=0;
84 QString placeName = "";
85 if (attributes.longitude.isSet())
86 longitude = attributes.longitude;
87 if (attributes.latitude.isSet())
88 latitude = attributes.latitude;
89 if (attributes.altitude.isSet())
90 altitude = attributes.altitude;
91 if (attributes.placeName.isSet())
92 placeName = attributes.placeName;
93 locationEditor.setGeography(lid, longitude,latitude, altitude, placeName);
94}
95
96void DateEditor::hideEvent(QHideEvent* event) {
97 Q_UNUSED(event); // suppress unused

Callers 1

setContentMethod · 0.45

Calls 3

setAuthorMethod · 0.80
isSetMethod · 0.45
setGeographyMethod · 0.45

Tested by

no test coverage detected