[Kde-pim] KDE 3.5.final?
Jonathan Marten
jjm2 at keelhaul.demon.co.uk
Fri Sep 5 08:00:53 BST 2008
Ingo Klöcker <kloecker at kde.org> writes:
> Frankly, the following piece of code looks pretty strange to me.
>
> + KMFolder *folder = account->folder(); // init
> folder's account list
> + if ( folder && !folder->hasAccounts() )
> + account->setFolder( folder, true );
>
> Why set the folder of an account to the folder it is already set to? The
> code looks very fragile because it seems to make assumptions about the
> internals of other classes. I'll need more time to investigate whether
> this really is the best way to fix the problem.
That was my code. It works because KMAccount::setFolder has a side
effect, it calls KMAcctFolder::addAccount which initialises the
folder's account list (KMFolder::mAcctList). This list is then checked
in FolderTreeBase::hideLocalInbox (via KMFolder::hasAccounts) to
decide whether the inbox is to be shown.
Unless this is done, the folder's account list is never initialised
with the newly created account.
Regards,
Jonathan
--
Jonathan Marten http://www.keelhaul.demon.co.uk
Twickenham, UK jjm at keelhaul.demon.co.uk
_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/
More information about the kde-pim
mailing list