19 Commits

Author SHA1 Message Date
015659d58f Allow a note to be renamed to whatever
Earlier one could never change a note type, and therefore its extension.
Now you can rename a note's filename to whatever and accordingly the
editor will change.

A warning message is shown when changing the file type.

Fixes #474
2021-11-15 12:39:12 +01:00
e1ea7a4953 Fetch the modified + created time from git
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.
2021-10-26 17:49:08 +02:00
28f34ca5e6 Avoid catching only Exceptions
We also occasionally get Errors in runtime. It seems like a terrible
decission for Error and Exception to not have a common subtype.
2021-10-20 09:59:14 +02:00
729764c518 Remove NoteLoadState
It's no longer required as a Note can never be in an Error state, it
becomes an 'IgnoredFile'
2021-10-18 13:09:47 +02:00
7a56d0f423 Remove Note's default constructor
Instead there is a new type called 'UnopenedFile'. This was part of my
effort to not have everything inside the 'Note' class and to make it a
bit more immutable.

But, wow, this took a very long time. The 'Note' class seems to be very
deeply integrated everywhere.
2021-10-18 13:03:22 +02:00
5f07543db2 Remove Note's doc setter
This makes us one step closer to making the Note class immutable which
will help GitJournal's overall architecture a lot. Plus it makes me one
step closer to having proper web support.
2021-10-17 22:22:33 +02:00
7f9beb0d5c NoteFileTypes: Hook up selector to the settings 2021-10-15 17:33:19 +02:00
be038c7e3e Ensure metadata is not stored when disabled
Fixes #544
2021-10-12 14:43:57 +02:00
1bf2f2f5be Avoid logging failed notes
These mostly seem to be due to utf8 compatibilities.

Fixes APP-1EQ
2021-10-11 21:43:11 +02:00
7e0a77ace3 Fix many cases of 'avoid-ignoring-return-values'
Now that dart-code-metrics has been updated, this lint can finally be
used. So far all of these are false positives, in the sense that I don't
care about their return values.

I wish there was an easy way of marking functions whose return value
shouldn't ever be ignored.
2021-09-27 18:39:18 +02:00
ee4c48b186 Note.save: Make sure the lastModified is exactly right
Otherwise the cache isn't always valid.
2021-09-17 09:57:38 +02:00
4bf0a78fee MaterializedView: Avoid re-computing many times
Ideally the Note's lastModified shouldn't ever be 0.
2021-09-17 09:55:33 +02:00
af7665bc5a Avoid logging the note's value
Urgh, so stupid.
2021-09-17 08:35:58 +02:00
510b277398 Add Note.apply
Avoid calling each setter as each results in the entire tree being
rebuilt.
2021-09-16 20:07:33 +02:00
33a731a3d7 Add reuse licensing to files in lib 2021-09-15 13:06:43 +02:00
cfaf1436f1 Move the MarkdownYamlCodec out of the Note class 2021-09-09 10:08:38 +02:00
fdc79828c7 Move note.load to NoteStorage
Now the note class is almost ready to become immutable
2021-09-09 10:01:36 +02:00
a0a97aa8cb Cleanup code 2021-08-04 08:17:49 +02:00
39096c270c Note.save: Move to NoteStorage
I'm trying to move all FS related operations out of the Note class, and
ideally make it super small. This class will need to be serialized over
the wire for the web version, and that needs it to be small.
2021-08-04 08:03:48 +02:00