Commit graph

5472 commits

Author SHA1 Message Date
dd453659ed Refactor imag-mv to fit new store iterator interface 2018-05-01 17:44:01 +02:00
e6244d7e9e Refactor imag-todo to fit new store iterator interface 2018-05-01 17:44:01 +02:00
eaf8148cda Refactor imag-ids to fit new store iterator interface 2018-05-01 17:44:01 +02:00
40a04376ed Refactor imag-link to fit new store iterator interface 2018-05-01 17:44:01 +02:00
d08c27e623 Rewrite StoreIdIterator extensions
This patch reimplements the iterator extensions.

As we iterate (in StoreIdIterator) over Result<StoreId> now anyways, we
don't need the extensions for Result iterators anymore.

This patch rewrites the extensions to be more simple in every way and
generic over the error type in the iterator.
All the errors have to do is implement From<StoreError>, which is what
they do when linking the generated error types with error_chain to the
libimagstore error types.
2018-05-01 17:44:01 +02:00
6ee3f4a3f6 Refactor libimagentrycategory to fit new store iterator interface 2018-05-01 17:44:01 +02:00
6f81d02445 Refactor libimagentryannotation to fit new store iterator interface 2018-05-01 17:44:01 +02:00
40688a3c2d Refactor libimagwiki to fit new store iterator interface 2018-05-01 17:44:01 +02:00
715753ed25 Refactor libimagtodo to fit new store iterator interface 2018-05-01 17:44:01 +02:00
72c83ae3f7 Refactor libimagtimetrack to fit new store iterator interface 2018-05-01 17:44:01 +02:00
08114bbf36 Refactor libimagnotes to fit new store iterator interface 2018-05-01 17:44:00 +02:00
e643f36fa3 Refactor libimaghabit to fit new store iterator interface 2018-05-01 17:44:00 +02:00
bf0bef058d Refactor libimagdiary to fit new store iterator interface 2018-05-01 17:44:00 +02:00
8f03b4a71a Refactor libimagcontact to fit new store iterator interface 2018-05-01 17:44:00 +02:00
a2ff298e67 Rewrite Store::entries()
This patch rewrites the Store::entries() function to not be collecting
the iterator.

It therefore introduces a new, internal, iterator type which creates the
StoreId objects from the pathes the PathIterator yields internally.

With this patch, the Store iterator interface changes, as the iterators
now yield `Result<StoreId, StoreError>` instead of `StoreId`.
This is necessary, as the internal conversion errors shouldn't be
hidden.

Of course, the iterator types (like the StoreGetIterator and so on)
should hold a Result<StoreId> internally as well, and also yield
appropritely. This was changed in this commit, too.
2018-05-01 17:44:00 +02:00
f4556f3983 Rewrite backend to not collect on pathes_recursively() 2018-05-01 17:44:00 +02:00
d45eef299e
Merge pull request #1476 from matthiasbeyer/imag-diagnostics/refactor
Minify code with helper macro
2018-04-30 21:49:24 +02:00
424a060cc8
Merge pull request #1475 from matthiasbeyer/imag-diagnostics/flush-cache
imag-diagnostics: flush cache
2018-04-30 21:07:56 +02:00
900d9f0984
Merge pull request #1474 from matthiasbeyer/libimagstore/cache-flush
Add functionality to flush the internal cache
2018-04-30 21:07:37 +02:00
41615bcc97
Merge pull request #1473 from matthiasbeyer/libimagstore/more-error-information
Add information about which storeid is the cause of the error in errors
2018-04-30 21:07:02 +02:00
6a5bcb2709 Remove unused error kinds 2018-04-30 18:54:11 +02:00
6a40ac6b98 Add information about which storeid is the cause of the error in errors 2018-04-30 18:53:54 +02:00
1e2e47c388
Merge pull request #1472 from matthiasbeyer/libimagtodo/refactor-error-handing
Refactor error handling, use more error chaining
2018-04-30 18:40:42 +02:00
004faaa905 Performe cache flushing during aggregation 2018-04-30 18:40:19 +02:00
860e47a256 Add functionality to flush the internal cache
Before we had the problem that when iterating over _a lot_ (like 5k)
entries and also fetching them, at some point the OS would return with
"Too many files open".

That is because the store internally caches a lot.

With this change, the Store gets an API to query how big the cache is,
how much the cache can currently hold and (and that's the main thing in
this patch) to flush the cache to disk.

A function to simply ask the store whether its cache should be flushed
(which would us require to ask the OS how many files we can open...
which would be possible with `libc::getrlimit`) does not yet exist,
though, but could be added easily if desired.
2018-04-30 18:39:59 +02:00
ebc2e49c5b
Merge pull request #1469 from matthiasbeyer/imag-diary/remove-edit-command
Remove the edit command
2018-04-30 17:33:35 +02:00
b3cf96d88b Refactor error handling, use more error chaining 2018-04-30 17:29:27 +02:00
b713718693 Minify code with helper macro 2018-04-30 14:15:34 +02:00
58a6eea573 Remove the edit command
The edit command of imag-diary gets removed by this patch.

The rationale is that imag-edit is way more powerful and thus, not every
other imag module should implement an edit command. Chaining
`imag-diary list` and `imag edit -I` is encouraged.

We still need the edit functionality in imag-diary, as `imag diary
create` shall spawn an editor, still. We only remove the ability for
editing of existing entries with this patch.
2018-04-30 14:04:16 +02:00
76966bcd6c
Merge pull request #1467 from matthiasbeyer/libimagentryfilter/failable
libimagentryfilter: failable
2018-04-29 14:21:09 +02:00
fc92cfc36f Move header filters to FailableFilter 2018-04-29 11:43:32 +02:00
30ac77d626 Add error module 2018-04-29 11:43:32 +02:00
e08ec34893 Remove empty module 2018-04-29 11:43:32 +02:00
ecf1768a8d
Merge pull request #1466 from matthiasbeyer/update-filters
Update dependency: filters: 0.2 -> 0.3
2018-04-29 11:43:19 +02:00
6d21d8eb49 Update dependency: filters: 0.2 -> 0.3 2018-04-29 10:46:36 +02:00
0976cab014
Merge pull request #1464 from matthiasbeyer/libimagentrygps/32-bit-gps-values
libimagentrygps: 32 bit gps values
2018-04-29 00:35:21 +02:00
dbb39475d9 Upgrade variables to 64 bit 2018-04-28 23:27:12 +02:00
93c3bb5862 Upgrade variables to 64 bit 2018-04-28 23:27:12 +02:00
f493b4b8c3 Fix: Allow second to be missing 2018-04-28 23:18:02 +02:00
5870fa0785 Fix: Use 16 bit variables for GPS degree/minute/second 2018-04-28 23:18:02 +02:00
1dd5cb5565
Merge pull request #1459 from matthiasbeyer/libimagcontact/email-properties
libimagcontact/imag-contact: Email properties
2018-04-28 13:46:52 +02:00
713621337f Adapt for new libimagcontact interface 2018-04-27 16:57:48 +02:00
5f3b7b31e7 Add support for storing email properties
We have to move the `Email` type at the bottom of the DeserVcard type
because it contains a table and we must emit tables as last values when
de/serializing.

Maybe this will shoot us in the foot later, but only with TOML I guess.
We'll see. For now, this is good.

For that we need to update a dependency: vobject -> 0.5
2018-04-27 16:57:37 +02:00
bfd536d3fb
Merge pull request #1460 from matthiasbeyer/imag-contact/warn-if-no-extension
Set extension or warn if none there
2018-04-27 14:46:39 +02:00
ead8413c12
Merge pull request #1451 from matthiasbeyer/libimagcategory/rewrite-with-linking
libimagcategory: rewrite with linking
2018-04-27 14:18:38 +02:00
932ba3e7d4 Set extension or warn if none there
In case of auto-generating the file name, we should add an extension.
If we do not auto-generate the file name, we should warn that the
extension for the file is missing.
2018-04-27 13:58:46 +02:00
82867f3ff6 Fix tests for new interface 2018-04-27 13:24:59 +02:00
493fa0226c
Merge pull request #1453 from matthiasbeyer/imag-contact/create-uid
Fix: Generate UID when creating a contact
2018-04-26 16:16:33 +02:00
47c4a360f7
Merge pull request #1454 from matthiasbeyer/imag-contact/do-not-require-fields
Fix: Make most fields optional
2018-04-26 16:14:48 +02:00
ad9eb62376 Fix: Generate UID when creating a contact 2018-04-26 14:43:21 +02:00