<table><tr><td style="">poboiko created this revision.<br />poboiko added reviewers: dvratil, mlaurent.<br />Herald added a project: KDE PIM.<br />poboiko requested review of this revision.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D27905">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>When user adds new maildir, a new resource gets created, with the default<br />
directory <tt style="background: #ebebeb; font-size: 13px;">~/.local/share/local-mail</tt>. Since it's a new resource, with no<br />
proper configuration, an <tt style="background: #ebebeb; font-size: 13px;">attemptConfigRestoring()</tt> is called, which changes<br />
it to <tt style="background: #ebebeb; font-size: 13px;">~/.local/share/akonadi_maildir_resource#</tt>. It's stored inside<br />
<tt style="background: #ebebeb; font-size: 13px;">mSettings->path()</tt>.</p>

<p>Then a dialog appears, where user can choose prefered directory. It gets<br />
written to the config file; then <tt style="background: #ebebeb; font-size: 13px;">configurationChanged</tt> gets called.<br />
We call <tt style="background: #ebebeb; font-size: 13px;">mSettings->save()</tt>, which overwrites the path provided by user with<br />
the default one (<tt style="background: #ebebeb; font-size: 13px;">~/.local/share/akonadi_maildir_resource#</tt>), making it<br />
impossible to create a new maildir anywhere else.</p>

<p>Just use <tt style="background: #ebebeb; font-size: 13px;">load()</tt> instead, it makes more sense when configuration wa changed.</p>

<p>Also, if we use <tt style="background: #ebebeb; font-size: 13px;">load()</tt>, then the first <tt style="background: #ebebeb; font-size: 13px;">configurationChanged</tt> changes the<br />
name of the resource to <tt style="background: #ebebeb; font-size: 13px;">local-mail</tt> (even before the user provides the name).<br />
After user sets the directory, the name remains <tt style="background: #ebebeb; font-size: 13px;">local-mail</tt>, which doesn't<br />
make sense. Instead, this patch always sets the name to the name of the<br />
directory.</p>

<p>BUG: 416287<br />
CCBUG: 415245<br />
CCBUG: 415922</p></div></div><br /><div><strong>TEST PLAN</strong><div><ol class="remarkup-list">
<li class="remarkup-list-item">Create a new maildir resource pointing to <tt style="background: #ebebeb; font-size: 13px;">/tmp/dummy</tt>.</li>
<li class="remarkup-list-item">The resource gets created, with the name <tt style="background: #ebebeb; font-size: 13px;">dummy</tt>. <tt style="background: #ebebeb; font-size: 13px;">/tmp/dummy</tt> gets created.</li>
<li class="remarkup-list-item">Drop some mails into it via KMail. Mails appear inside <tt style="background: #ebebeb; font-size: 13px;">/tmp/dummy</tt></li>
</ol></div></div><br /><div><strong>REPOSITORY</strong><div><div>R44 KDE PIM Runtime</div></div></div><br /><div><strong>BRANCH</strong><div><div>maildir-settings (branched from master)</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D27905">https://phabricator.kde.org/D27905</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>resources/maildir/maildirresource.cpp</div></div></div><br /><div><strong>To: </strong>poboiko, dvratil, mlaurent<br /><strong>Cc: </strong>kde-pim, fbampaloukas, dcaliste, dvasin, rodsevich, winterz, vkrause, mlaurent, knauss, dvratil<br /></div>