void Chunk::emitAdds() { for(const auto & n : _notes) { emit noteAdded(this,n.first); } }
QUuid ContextModel::createNote( QUuid pUuid ) { BaseListModel *Parent = ( mCurrentGroup.isNull() ? mRootItem : mNodeMap.value( mCurrentGroup )->children() ); if( !Parent ) { return( QUuid() ); } NoteModel *Note = new NoteModel( Parent ); if( !Note ) { return( QUuid() ); } QUuid NoteId = ( pUuid.isNull() ? QUuid::createUuid() : pUuid ); int NoteIdx = Parent->rowCount(); beginInsertRows( createIndex( Parent->row(), 0, Parent ), NoteIdx, NoteIdx ); Parent->appendChild( Note ); mNoteMap.insert( NoteId, Note ); endInsertRows(); emit layoutChanged(); emit noteAdded( NoteId ); return( NoteId ); }
void Cache::softLoad() { clearNotes(); clearSearches(); qDebug() << "Notes size: " << notes->size(); for(int i=0;i<notes->size();i++){ Note note = notes->at(i); if (m_sel_notebook) { if (note.notebookGuid == m_sel_notebook->guid){ NoteWrapper* noteWrapper = new NoteWrapper(note); noteAdded(noteWrapper); } } else { NoteWrapper* noteWrapper = new NoteWrapper(note); noteAdded(noteWrapper); } } }
void FileStorage::putToCache(const NoteListItem ¬e) { ensureChachePopulated(); bool isModify = cache.contains(note.id); cache.insert(note.id, note); if (isModify) { emit noteModified(note); } else { emit noteAdded(note); } }
void Cache::load(){ tags = DatabaseManager::instance()->getTags(); notebooks = DatabaseManager::instance()->getNotebooks(); notes = DatabaseManager::instance()->getNotes(); searches = DatabaseManager::instance()->getSavedSearches(); clearNotes(); clearSearches(); qDebug() << "Notes size: " << notes->size(); for(int i=0;i<notes->size();i++){ Note note = notes->at(i); if (m_sel_notebook) { if (note.notebookGuid == m_sel_notebook->guid){ NoteWrapper* noteWrapper = new NoteWrapper(note); noteAdded(noteWrapper); } } else { NoteWrapper* noteWrapper = new NoteWrapper(note); noteAdded(noteWrapper); } } }
void Chunk::addNote(const ChunkNote ¬e) { if(_lower_octave == -1 or note.octave() < _lower_octave) _lower_octave = note.octave(); if(_upper_octave == -1 or note.octave() > _upper_octave) _upper_octave = note.octave(); Range * range = 0; if(_scene != 0) { range = _scene->mark_view(note); } _notes.insert(std::make_pair(note,range)); emit(noteAdded(this,note)); }
void XmlNotes::insertID(const QString &id) { notesID << id; emit noteAdded(id); }
void Cache::fireNoteAdded(NoteWrapper *note) { noteAdded(note); }