Commit Graph

6212 Commits

Author SHA1 Message Date
Matthias Beyer 204da1b0bd Remove libimagnotification
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-04-22 14:05:55 +02:00
Matthias Beyer cf234437d7 Implement Partial for Config
With this implemented, we can fetch the appropriate configuration easily
from the configuration.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-04-22 13:06:26 +02:00
Matthias Beyer 2854e88dcc Rename: "ref.collection" to "ref.basepath"
The setting in the header should reflect the name of the setting in the
configuration file, for a better user experience.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-04-22 13:06:26 +02:00
Matthias Beyer 7ae2d926cc Use toml-query master branch during development
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-04-22 13:06:26 +02:00
Matthias Beyer 1876220d83 Rewrite github template 2019-04-21 13:51:55 +02:00
Matthias Beyer 31e3116b48 Revert "Remove GetIter"
This reverts commit a49522dc86770a741d61d548351ad69dfc56d1fa.
2019-04-14 00:16:47 +02:00
Matthias Beyer b8cd9c6efa Add debug output
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-04-14 00:16:47 +02:00
Matthias Beyer aa3fdb88d5 Remove GetIter
Because the code is not used.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-04-14 00:16:47 +02:00
Matthias Beyer 4afebbe9e4 Remove FilterLinksIter
Because the code is not used.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-04-14 00:16:47 +02:00
Matthias Beyer 1f515b1d0d Remove DeleteUnlinkedIter
Because the code is not used.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-04-14 00:16:47 +02:00
Matthias Beyer 0283c3af7a Merge branch 'fix-path-iterator' into master-ff
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-04-13 23:42:20 +02:00
Matthias Beyer a4bcefe660 Merge branch 'rewrite-module-entry-path'
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-04-13 23:08:36 +02:00
Matthias Beyer 526885ee19 Fix: PathIterBuilder should not yield directories
PathIterBuilder should yield iterator that does only yield file pathes,
not directories.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-04-13 23:00:06 +02:00
Matthias Beyer cb4d5367e4 Rewrite all usages of ModuleEntryPath
Because the code was so complex before, we had to create an object and
then cast that object into a `StoreId` rather than just creating a
`StoreId` object right away.

With this patch, we're using the code-generation approach to generate a
function that creates a `StoreId` object based on the name of the
current module. That's way easier and error handling was also improved
by the switch to the new implementation.

The patch also includes a rewrite of all usages of ModuleEntryPath and
changes them to `module_path::new_id()` calls.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-04-13 22:39:39 +02:00
Matthias Beyer de522ec0f2 Fix for rust beta compiler
The beta compiler reports duplicated input:

error: the item `IntoValues` is imported redundantly
   --> lib/entry/libimagentrylink/src/internal.rs:398:13
    |
36  | use self::iter::IntoValues;
    |     ---------------------- the item `IntoValues` is already imported here
...
398 |         use internal::iter::IntoValues;
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^
    |

so we fix this here.

Other imports were fixed as well.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-04-13 22:06:53 +02:00
Matthias Beyer 630090dd57 travis: Update rustc to 1.32.0 / 1.33.0
We use 1.32.0 as minimum required version.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-04-13 18:54:51 +02:00
Matthias Beyer 82a2fa1528 Remove old TODO
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-03-09 13:30:12 +01:00
Matthias Beyer 19622f41ae Do not ignore errors when collecting links
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-03-09 13:30:12 +01:00
Matthias Beyer 581da9c9cf Remove old comment
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-03-09 13:30:12 +01:00
Matthias Beyer 71cccad665 Remove old comment
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-03-09 13:30:12 +01:00
Matthias Beyer ca2f130995 Rewrite: Diary::get_youngest_entry_id()
Rewrite to collect not so often internally. This removes one collect()
from the implementation. One is still there in the sorted_by() call,
though.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-03-09 13:30:12 +01:00
Matthias Beyer 205c2b09b6 Remove outcommented code
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-03-09 12:26:21 +01:00
Matthias Beyer 9af10fd2eb Fix indention
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-03-09 12:24:40 +01:00
Matthias Beyer 734112b856 Simplify
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-03-09 12:24:20 +01:00
Matthias Beyer d19020c3f5 Remove unnecessary Error::from() call
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-03-09 12:24:09 +01:00
Matthias Beyer 341e64998d Remove Iterator::size_hint() implementation
I'm not sure why the author added this in the first place, but I bet we
don't need this.

So remove code we do not need. Feel free to prove me wrong and revert
this patch.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-03-07 20:53:12 +01:00
Matthias Beyer ae95022202 Optimize: Do not compute lowercase key twice
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-28 18:07:25 +01:00
Matthias Beyer ce678d6418 Fix: Compare different variables
The bug was that we compared the variable with itself, but one time to
lowercase and one time not, so it was always false.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-24 22:33:41 +01:00
Matthias Beyer ac914b27e2 Merge branch 'libimagmail-better-hash' into master
This merges improvements for the libimagmail hasher.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-22 11:34:26 +01:00
Matthias Beyer 211d6fa60b Add helper function to be more flexible
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-22 11:31:58 +01:00
Matthias Beyer 596af2fc76 Reimplement the hasher
We create a sha1 over the path of the file and the Message-ID of the
mail itself.

The file name is not constant with mail files, because flags are encoded
in the filename. The path is also not constant with mail files, because
they can be moved between boxes.

This approach is not yet the best one, but better than before.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-22 11:30:12 +01:00
Matthias Beyer d32f41aeab Outsource hashing itself so that we can re-use it
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-22 11:23:57 +01:00
Matthias Beyer b2fbf1e462 Add debug and trace output
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-20 23:14:43 +01:00
Matthias Beyer 44896327e5 Merge branch 'rewrite-mail-code' into master
This merge includes the rewritten mail infrastructure. It was rewritten
for the new libimagentryref API, but might not be complete in regards
towards maildir handling.

Also, it only contains minimal features, not even bulk-import is
implemented yet.

Also, sending, receiving and other nice-to-have MUA features are not yet
implemented.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-20 16:23:19 +01:00
Matthias Beyer dfc02a5679 Move helper function to libimagentref::util
This moves the helper function for getting the `Config` object from the
configuration file via the runtime.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-20 16:22:52 +01:00
Matthias Beyer a959167b15 Rewrite imag-mail
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-20 16:22:52 +01:00
Matthias Beyer a819aeb6ed Rewrite libimagmail
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-20 16:22:52 +01:00
Matthias Beyer 198c59f717 Revert "Remove imag-mail"
This reverts commit f9a980c344.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-20 16:22:52 +01:00
Matthias Beyer f84cc8169f Revert "Remove libimagmail"
This reverts commit 74045e1800.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-20 16:22:52 +01:00
Matthias Beyer 27c0a30494 Add config fetching function for Ref::get_path() parameter
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-20 14:43:42 +01:00
Matthias Beyer 34d9f3429f Add debug output
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-20 14:43:29 +01:00
Matthias Beyer 0a62548173 Add function to get relative file path
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-20 14:43:21 +01:00
Matthias Beyer 37bf2ce191 Fix: Use StoreIdWithBase::from_full_path
We iterate over full pathes to store entries here, which causes
`StoreId::new()` to error. But if we use the internal parsing helper
`StoreIdWithBase::from_full_path()` and then call `::into_storeid()` on
the resulting object, everything is fine.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-20 12:31:37 +01:00
Matthias Beyer ed862db76f Fix: Strip the prefix of the path
The previous implementation did not strip the prefix of the "relpath"
header value, which resulted in the whole path being in the header,
which is obviously wrong.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-20 12:31:37 +01:00
Matthias Beyer 04e006154c Fix: Use "ref.relpath" as path to header value
The header value for the relative path is at "ref.relpath". This fixes
the wrong selector.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-19 21:51:44 +01:00
Matthias Beyer 22c239c212 Add output about logger settings in logging setup
This way we can get trace-level information about the logger itself when
it is generated. Because from time to time we might want to have a look
at that.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-19 21:51:44 +01:00
Matthias Beyer 6681f9fcfd Remove unused code
Because the store is more efficient when reading and writing entries to
disk, we do not need to flush the cache anymore.

Hence, remove the flushing.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-18 16:02:49 +01:00
Matthias Beyer b5fe48b564 Remove serializing where result was unused
I'm not sure why this was still there, it seems that this was left out
when deleting older code.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-18 16:02:49 +01:00
Matthias Beyer c562f35222 Merge branch 'rewrite-libimagentryref'
This is the merge for the "ref"-infrastructure rewrite. Finally.

The refs are now stored with three bits of information:

    * The "collection" (named basepath)
    * The "relpath" (relative path)
    * The hash (sha1 as of now)

The "collection" is a name which has to be accociated with a path to a
directory (in the config file).
That gives the user the opportunity to have (for example) their music
collection in $HOME/music on one device and in $HOME/media/music on
another.
The "relpath" is the relative path, which results in the path to the
actual file when being joined with the "collection" path.

The hash is a sha1 hash as of now. Re-checking this hash with
libimagentryref is not yet tested.

This merge also removes the "mail" code completely, for the sake of
seperating concerns into branches. The respective commits might be
removed later.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-17 11:44:54 +01:00
Matthias Beyer f9a980c344 Remove imag-mail
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2019-02-17 11:09:49 +01:00