Ejemplo n.º 1
0
void Chunk::removeNote(const ChunkNote &note)
{

    qDebug()<<"Looking for note "<<note;
    qDebug()<<"In :";
    for(auto & n : _notes)
    {
        qDebug()<<n.first;
    }

    if(_scene != 0)
    {
        ChunkNotes::iterator i = _notes.find(note);
        if(i != _notes.end())
        {
            _scene->unmark_view(i->second);
        }
        else
        {
            qDebug("CANNOT FIND NOTE");
        }
    }

    _notes.erase(note);

    emit(noteRemoved(this, note));

}
Ejemplo n.º 2
0
void XmlNotes::removeNote(const QString &id)
{
    //DEBUG_FUNC_NAME
    QMap<QString, QString>  ref = notesRef.value(id);
    notesType.remove(id);
    notesTitle.remove(id);
    notesData.remove(id);
    notesRef.remove(id);
    notesID.removeOne(id);
    emit noteRemoved(id, ref);
}
Ejemplo n.º 3
0
void FileStorage::deleteNote(const QString &noteId)
{
    QHash<QString, NoteListItem>::const_iterator r = cache.find(noteId);
    if (r != cache.end()) {
        if (QFile::remove( QDir(notesDir).absoluteFilePath(
                QString("%1.%2").arg(noteId).arg(fileExt)) )) {
            NoteListItem item = r.value();
            cache.remove(r.key());
            emit noteRemoved(item);
        }
    }
}