D27905: [resources/maildir] Reload configuraton on configuration change
Igor Poboiko
noreply at phabricator.kde.org
Fri Mar 6 22:00:56 GMT 2020
poboiko created this revision.
poboiko added reviewers: dvratil, mlaurent.
Herald added a project: KDE PIM.
poboiko requested review of this revision.
REVISION SUMMARY
When user adds new maildir, a new resource gets created, with the default
directory `~/.local/share/local-mail`. Since it's a new resource, with no
proper configuration, an `attemptConfigRestoring()` is called, which changes
it to `~/.local/share/akonadi_maildir_resource#`. It's stored inside
`mSettings->path()`.
Then a dialog appears, where user can choose prefered directory. It gets
written to the config file; then `configurationChanged` gets called.
We call `mSettings->save()`, which overwrites the path provided by user with
the default one (`~/.local/share/akonadi_maildir_resource#`), making it
impossible to create a new maildir anywhere else.
Just use `load()` instead, it makes more sense when configuration wa changed.
Also, if we use `load()`, then the first `configurationChanged` changes the
name of the resource to `local-mail` (even before the user provides the name).
After user sets the directory, the name remains `local-mail`, which doesn't
make sense. Instead, this patch always sets the name to the name of the
directory.
BUG: 416287
CCBUG: 415245
CCBUG: 415922
TEST PLAN
1. Create a new maildir resource pointing to `/tmp/dummy`.
2. The resource gets created, with the name `dummy`. `/tmp/dummy` gets created.
3. Drop some mails into it via KMail. Mails appear inside `/tmp/dummy`
REPOSITORY
R44 KDE PIM Runtime
BRANCH
maildir-settings (branched from master)
REVISION DETAIL
https://phabricator.kde.org/D27905
AFFECTED FILES
resources/maildir/maildirresource.cpp
To: poboiko, dvratil, mlaurent
Cc: kde-pim, fbampaloukas, dcaliste, dvasin, rodsevich, winterz, vkrause, mlaurent, knauss, dvratil
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20200306/8a67b640/attachment.html>
More information about the kde-pim
mailing list