Commit graph

583 commits

Author SHA1 Message Date
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
82867f3ff6 Fix tests for new interface 2018-04-27 13:24:59 +02:00
f0969db47c Rewrite
This patch rewrites the whole libimagcategory and brings it to a nice
standard (the code before was rather messy).

Now, categories are represented by an entry in the store and all entries
which have this category are linked to that entry.
2018-04-26 12:05:28 +02:00
9fc9e7fe17 Outsource iterator in iter module 2018-04-26 12:05:28 +02:00
ab15d89e64 Rewrite CategoryRegister as CategoryStore 2018-04-26 12:05:28 +02:00
5f305ef7a7 Add module for category handling 2018-04-26 12:05:28 +02:00
c26f1aae2a This module should be named "entry" 2018-04-26 11:20:40 +02:00
f321aa82a1 Make sure category is linked when setting it 2018-04-26 11:20:09 +02:00
0bacfb0a88
Merge pull request #1446 from matthiasbeyer/travis-clippy
Travis: clippy
2018-04-26 10:25:45 +02:00
ea80a5a09b Derive Default for InMemoryFileAbstraction, remove constructor 2018-04-25 19:15:07 +02:00
6a34e7a8fd Derive Default for FSFileAbstraction, reduces boilerplate 2018-04-25 19:15:07 +02:00
bf363c4748 Use "if let" if matching on a single pattern 2018-04-25 19:15:07 +02:00
f1142c414d Use ok_or_else() instead of ok_or() 2018-04-25 19:15:07 +02:00
22170a0d55 Do not String::from(String) 2018-04-25 19:13:51 +02:00
6f5590713a Use single quotes here 2018-04-25 19:13:51 +02:00
44521a7c8c Dont use "return" keyword at end of function 2018-04-25 19:13:51 +02:00
dc18e650bb Collapse nested if-else-if 2018-04-25 19:13:51 +02:00
67675b2ab2 Remove unecessary clone 2018-04-25 19:13:51 +02:00
a25f650ca0 Be more ergonomic here 2018-04-25 19:13:51 +02:00
84249e3fb5 Be less verbose when constructing an object
The rust compiler does some fancy things for us: It automatically finds
the right fields if the name of the variable and the file is the same.

Lets use that to reduce boilerplate with this patch.
2018-04-25 19:13:50 +02:00
154c2e482b Change generate_variants() helper to use base by ref 2018-04-25 19:13:50 +02:00
42c4186dec Use or_else() instead of or() 2018-04-25 19:13:50 +02:00
80c07171aa Make sure we can deserialize
Use default values when field is not there when we deserialize. This
does automatically the right thing.
2018-04-25 13:45:00 +02:00
56c1b78d93 Add getters for DeserVcard helper type 2018-04-25 13:45:00 +02:00
abc142f4b5 Rewrite library
libimagcontact stores all contact information in the entry header now.
2018-04-25 12:54:01 +02:00
3eab3af7b0 Remove all libimagentryref usage 2018-04-25 11:30:42 +02:00
775508a6ed Refactor: Use AsRef<str> instead of String as arg type 2018-04-24 23:12:14 +02:00
488ce9fe91 Clippy fixes 2018-04-24 23:12:14 +02:00
524c391ee0 Remove unused dependency 2018-04-24 22:16:40 +02:00
563c76c375 Remove "stdio" file abstraction from store implementation 2018-04-24 22:16:40 +02:00
19e0471f5b Remove tests with JsonMapper in backend 2018-04-24 22:16:40 +02:00
ba453323ba Remove support for changing store backend 2018-04-24 22:16:40 +02:00
d12844aff0 Add markdown viewer functionality 2018-04-24 18:06:45 +02:00
55d9b5456f Adapt to new libimagentryview interface
And properly implement Viewer for DiaryViewer
2018-04-24 16:46:15 +02:00
780dd90c8f Rewrite libimagentryview interface
In the previous versions, the sink (where the entries should be written
to) was not passed.

This did conflict with the libimagrt holding the stdout/stderr handles,
because it automatically writes to stdout (which we don't want to do in
some cases).

Passing the sink is way nicer. This patch changes libimagentryview so
that the sink is passed to the viewer.
2018-04-24 16:46:15 +02:00
5666ef12d0 Rewrite to not use Store::retrieve_for_module() 2018-04-24 14:01:40 +02:00
2c52957b63 Replace call to retrieve_for_module() with entries()
The iterator type handles everything else.
2018-04-24 13:40:42 +02:00
190da895f9 Do not use Store::retrieve_for_module() anymore here 2018-04-24 13:40:42 +02:00
22fb26dc12 Replace Store::retrieve_for_module() with own iterator type 2018-04-24 13:40:42 +02:00
007c02c2f1 Rewrite all_category_names() for removed Store::retrieve_for_module() 2018-04-24 13:40:42 +02:00
255f4211c9 Rewrite use of iterator with own iterator implementation 2018-04-24 13:40:42 +02:00
bae9188a08 Remove GlobStoreIdIterator helper iterator type 2018-04-24 13:40:42 +02:00
d70092d691 Remove: Store::retrieve_for_module 2018-04-24 13:40:42 +02:00
9303a72a28
Merge pull request #1436 from matthiasbeyer/imag-log/show-ordered
Fix: imag-log show should order by datetime
2018-04-22 15:55:25 +02:00
93226ce987
Merge pull request #1434 from matthiasbeyer/libimagdiary/fix-youngest-entry
Fix: get_youngest_entry_id()
2018-04-22 15:06:26 +02:00
ee75d2309c Fix: imag-log show should order by datetime 2018-04-22 14:33:53 +02:00
86b60295ee Fix: get_youngest_entry_id()
We need to reverse the iterator for getting the _youngest_ entry here.

Also seems to fix the issue that imag-diary edit -d <date> did not work
properly.
2018-04-22 14:11:19 +02:00
19940d3e1c Set version string by hand here if we do not build with cargo 2018-04-22 13:38:24 +02:00
8262de29fe Update dependency: log: 0.4.0-rc.1 -> 0.4 2018-04-20 20:19:02 +02:00
d08a5ab536
Merge pull request #1417 from matthiasbeyer/libimagrt/suggest-imag-init
Suggest imag-init if no config is found
2018-04-20 09:24:44 +02:00