[KPhotoAlbum] [PATCH 1/3] Cleanup: SettingsData: Super minor simplifications

Henner Zeller h.zeller at acm.org
Tue Sep 23 17:19:17 BST 2008


On Tue, Sep 23, 2008 at 4:30 PM, Michael Witten <mfwitten at mit.edu> wrote:
>
> On 23 Sep 2008, at 9:18 AM, Jan Kundrát wrote:
>
>> Michael Witten wrote:
>>> bool SettingsData::ready()
>>> {
>>> -    return _instance != 0;
>>> +    return _instance;
>>> }
>>
>> While not remove this function altogether?
>
> It would be safest to remove this when we have better
> guarantees on a "more obvious singleton". Currently,
> ready() is being used here:
>
>        void MainWindow::Window::resizeEvent( QResizeEvent* );
>        void MainWindow::Window::moveEvent( QMoveEvent * );

I guess what Jan meant to say is if we already create the instance in
main(), we don't have to check everywhere if it is ready.

>
> so might as well not remove it yet.
>
>>> void SettingsData::setup( const QString& imageDirectory )
>>> {
>>> -    _instance = new SettingsData( imageDirectory );
>>> +    if ( !_instance )
>>> +        _instance = new SettingsData( imageDirectory );
>>> }
>>
>> You've already spoken about that on irc, perhaps turning these to
>> "more obvious singletons" won't harm...
>
> OK. I'll look into it.
>
>> cd /local/pub && more beer > /dev/mouth
>
> :-)
> _______________________________________________
> KPhotoAlbum mailing list
> KPhotoAlbum at kdab.net
> http://mail.kdab.net/mailman/listinfo/kphotoalbum
>



More information about the Kphotoalbum mailing list