[Kde-pim] [kdepim] mailcommon: Don't attempt to access the kernel settings if the kernel hasn't

Andras Mantia amantia at kde.org
Sat Dec 3 21:34:28 GMT 2011


Hi,

Allen Winter wrote:

> Git commit 90092b6b936bb1bd7ee4487e7494c8629640a8f9 by Allen Winter.
> Committed on 01/12/2011 at 02:14.
> Pushed by winterz into branch 'master'.
> 
> Don't attempt to access the kernel settings if the kernel hasn't
> been registered yet.

I mentioned this on IRC, but here it goes again for the record.

> diff --git a/mailcommon/mailkernel.h b/mailcommon/mailkernel.h
> index b89c7c9..a9043b7 100644
> --- a/mailcommon/mailkernel.h
> +++ b/mailcommon/mailkernel.h
> @@ -73,6 +73,10 @@ public:
>      mSettingsIf = settingsIf;
>    }
>  
> +  bool settingsAreRegistered() const {
> +    return mSettingsIf != 0;
> +  }
> +
>    ISettings *settingsIf() const {
>      Q_ASSERT( mSettingsIf );
>      return mSettingsIf;


I am not happy with this addition. The two are basically the same in release 
mode, and the assert is there because settings interface should always be 
registered.

So what you did below in foldertreewidget.cpp looks more like a workaround.
Instead of that it should be found why that code is called before the 
settings interface being registered. 
The same goes btw for kernelIsRegistered(), I'm not sure why it was added. 
The docs clearly say that KernelIf, SettingsIf, FilterIf must be registered 
before other Kernel::self() methods can be used.

Andras
_______________________________________________
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