mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-29 10:17:16 +08:00
NotesFolder: Listen to the proper Note's signal
This commit is contained in:
@ -226,7 +226,7 @@ class NotesFolder
|
|||||||
|
|
||||||
void add(Note note) {
|
void add(Note note) {
|
||||||
assert(note.parent == this);
|
assert(note.parent == this);
|
||||||
note.addListener(_entityChanged);
|
note.addModifiedListener(_noteModified);
|
||||||
|
|
||||||
_notes.add(note);
|
_notes.add(note);
|
||||||
_entityMap[note.filePath] = note;
|
_entityMap[note.filePath] = note;
|
||||||
@ -237,7 +237,7 @@ class NotesFolder
|
|||||||
void insert(int index, Note note) {
|
void insert(int index, Note note) {
|
||||||
assert(note.parent == this);
|
assert(note.parent == this);
|
||||||
assert(index >= 0);
|
assert(index >= 0);
|
||||||
note.addListener(_entityChanged);
|
note.addModifiedListener(_noteModified);
|
||||||
|
|
||||||
_notes.insert(index, note);
|
_notes.insert(index, note);
|
||||||
_entityMap[note.filePath] = note;
|
_entityMap[note.filePath] = note;
|
||||||
@ -247,7 +247,7 @@ class NotesFolder
|
|||||||
|
|
||||||
void remove(Note note) {
|
void remove(Note note) {
|
||||||
assert(note.parent == this);
|
assert(note.parent == this);
|
||||||
note.removeListener(_entityChanged);
|
note.removeModifiedListener(_noteModified);
|
||||||
|
|
||||||
assert(_notes.indexWhere((n) => n.filePath == note.filePath) != -1);
|
assert(_notes.indexWhere((n) => n.filePath == note.filePath) != -1);
|
||||||
assert(_entityMap.containsKey(note.filePath));
|
assert(_entityMap.containsKey(note.filePath));
|
||||||
|
Reference in New Issue
Block a user