mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-08-06 15:21:21 +08:00

Fixes #78 This is probably the largest commit that I have ever made. From now on - every File always has an mtime and ctime which is fetched from git. Notes can optionally override that time by providing yaml metadata. Additionally the 'filePath' and 'folderPath' is now relative to the repoPath instead of being the full path. This will slow down GitJournal like crazy as all the mtimes and ctime still need to be cached. For my test repo it takes about 23 seconds for GitJournal to become responsive.
46 lines
859 B
Dart
46 lines
859 B
Dart
/*
|
|
* SPDX-FileCopyrightText: 2019-2021 Vishesh Handa <me@vhanda.in>
|
|
*
|
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
|
*/
|
|
|
|
import '../note.dart';
|
|
import 'notes_folder.dart';
|
|
import 'notes_folder_notifier.dart';
|
|
|
|
class VirtualNotesFolder with NotesFolderNotifier implements NotesFolder {
|
|
final List<Note> _notes;
|
|
final NotesFolderConfig _config;
|
|
|
|
VirtualNotesFolder(this._notes, this._config);
|
|
|
|
@override
|
|
List<Note> get notes => _notes;
|
|
|
|
@override
|
|
List<NotesFolder> get subFolders => [];
|
|
|
|
@override
|
|
bool get isEmpty => _notes.isEmpty;
|
|
|
|
@override
|
|
bool get hasNotes => _notes.isNotEmpty;
|
|
|
|
@override
|
|
NotesFolder? get parent => null;
|
|
|
|
@override
|
|
String get name => "";
|
|
|
|
@override
|
|
String get publicName => "";
|
|
|
|
@override
|
|
NotesFolder? get fsFolder {
|
|
return null;
|
|
}
|
|
|
|
@override
|
|
NotesFolderConfig get config => _config;
|
|
}
|