[KPhotoAlbum] Bug: View crashes

Jan Kundrát jkt at gentoo.org
Fri Sep 14 10:21:28 BST 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: <http://mail.kde.org/pipermail/kphotoalbum/attachments/20070914/b0b36529/attachment.sig>


More information about the Kphotoalbum mailing list