[KPhotoAlbum] Bug: View crashes

Jan Kundrát jkt at gentoo.org
Fri Sep 14 11:21:28 CEST 2007


Christoph Moseler wrote:
> DB::ImageDB::instance()->info(_list[ _current]) returns null for 
> filename set to "" (empty string).
> 
> But I couldn't figure out, why _list[ _current] is empty.

Well, QValueList's documentation is a bit vague on this, but I guess
that it (at least in this special case) behaves like an associative(!)
container, where "indexing" (operator[]()) with non-existing key simply
adds an item to the container, and this item is constructed by its
default contructor.

Indeed, when using your actions, Viewer::ViewerWidget::currentInfo() is
called while the _list is still empty.

I've added a check to the MainWindow::Window::launchViewer() that simply
shows all images in such case. I hope this won't be confusing, because:

a) EXIF search displays a dialog box saying "no images found" if there
are no matches to the query
b) browser widget won't let you perform search that would return zero images

And I've added yet another check that runs after the previous one. It is
necessary because user database might contain no pictures :].

Thanks for reporting,
-jkt

-- 
cd /local/pub && more beer > /dev/mouth

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 252 bytes
Desc: OpenPGP digital signature
Url : /mailman/pipermail/kphotoalbum/attachments/20070914/b0b36529/attachment.pgp 


More information about the KPhotoAlbum mailing list