[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-pim
Subject:    Re: [Kde-pim] KDE 3.5.final?
From:       Jonathan Marten <jjm2 () keelhaul ! demon ! co ! uk>
Date:       2008-09-05 7:00:53
Message-ID: ov4p4voz4q.fsf () keelhaul ! local
[Download RAW message or body]

Ingo Klöcker <kloecker@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@keelhaul.demon.co.uk
_______________________________________________
KDE PIM mailing list kde-pim@kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic