Exemplo n.º 1
0
bool BacklinksNoteAddin::check_note_has_match(const gnote::Note::Ptr & note, 
                                              const std::string & encoded_title)
{
  Glib::ustring note_text = note->xml_content();
  note_text = note_text.lowercase();
  return note_text.find(encoded_title) != Glib::ustring::npos;
}
Exemplo n.º 2
0
std::string NoteOfTheDay::get_content(
                            const Glib::Date & date,
                            const gnote::NoteManager & manager)
{
  const std::string title = get_title(date);

  // Attempt to load content from template
  const gnote::Note::Ptr template_note = manager.find(
                                                   s_template_title);

  if (0 != template_note) {
    std::string xml_content = template_note->xml_content();
    return xml_content.replace(xml_content.find(s_template_title, 0),
                               s_template_title.length(),
                               title);
  }
  else {
    return get_template_content(title);
  }
}