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

Method createNoteWithText

src/WizMainWindow.cpp:4253–4275  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4251}
4252
4253void WizMainWindow::createNoteWithText(const QString& strText)
4254{
4255 initVariableBeforCreateNote();
4256 QString strHtml = strText.toHtmlEscaped();
4257 QString strTitle = strHtml.left(strHtml.indexOf("\n"));
4258 if (strTitle.isEmpty())
4259 {
4260 strTitle = "New note";
4261 }
4262 else if (strTitle.length() > 200)
4263 {
4264 strTitle = strTitle.left(200);
4265 }
4266 strHtml = "<div>" + strHtml + "</div>";
4267 strHtml.replace(" ", "&nbsp;");
4268 strHtml.replace("\n", "<br />");
4269 WIZDOCUMENTDATA data;
4270 if (!m_category->createDocument(data, strHtml, strTitle))
4271 {
4272 return;
4273 }
4274 setFocusForNewNote(data);
4275}
4276
4277void WizMainWindow::showNewFeatureGuide()
4278{

Callers

nothing calls this directly

Calls 3

isEmptyMethod · 0.80
lengthMethod · 0.80
createDocumentMethod · 0.45

Tested by

no test coverage detected