mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-28 01:45:55 +08:00
NotesFolder: Add more debug information when loading
This will help better diagnose why files don't sometimes show up
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:fimber/fimber.dart';
|
||||
import 'package:path/path.dart' as p;
|
||||
import 'package:path/path.dart';
|
||||
|
||||
@ -161,6 +162,7 @@ class NotesFolder
|
||||
}
|
||||
|
||||
if (fsEntity is Directory) {
|
||||
Fimber.d("Found directory ${fsEntity.path}");
|
||||
var subFolder = NotesFolder(this, fsEntity.path);
|
||||
if (subFolder.name.startsWith('.')) {
|
||||
continue;
|
||||
@ -177,8 +179,10 @@ class NotesFolder
|
||||
|
||||
var note = Note(this, fsEntity.path);
|
||||
if (!note.filePath.toLowerCase().endsWith('.md')) {
|
||||
Fimber.d("Ignoring file ${fsEntity.path}");
|
||||
continue;
|
||||
}
|
||||
Fimber.d("Found file ${fsEntity.path}");
|
||||
note.addListener(_entityChanged);
|
||||
|
||||
_notes.add(note);
|
||||
@ -198,12 +202,14 @@ class NotesFolder
|
||||
_entityMap.remove(path);
|
||||
|
||||
if (e is Note) {
|
||||
Fimber.d("File $path was no longer found");
|
||||
var i = _notes.indexWhere((n) => n.filePath == path);
|
||||
assert(i != -1);
|
||||
var note = _notes[i];
|
||||
_notes.removeAt(i);
|
||||
notifyNoteRemoved(i, note);
|
||||
} else {
|
||||
Fimber.d("Folder $path was no longer found");
|
||||
var i = _folders.indexWhere((f) => f.folderPath == path);
|
||||
assert(i != -1);
|
||||
var folder = _folders[i];
|
||||
|
Reference in New Issue
Block a user