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

Michael Witten mfwitten at MIT.EDU
Tue Sep 23 15:30:59 BST 2008


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 * );

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

:-)


More information about the Kphotoalbum mailing list