[KPhotoAlbum] bug: searching for descriptions is broken
Jesper K. Pedersen
blackie at blackie.dk
Sat Nov 11 11:59:32 GMT 2006
Actually the real fix was to do the check for _description.isEmpty() instead
of txt.isEmpty()
Thanks
Jesper.
On Sunday 29 October 2006 18:05, Christoph Moseler wrote:
| Hi,
|
| searching for descriptions seems to be broken, can somebody confirm that?
|
| bool ImageSearchInfo::match( ImageInfoPtr info ) const
| [...]
| QString txt = info->description();
| if ( !txt.isEmpty() ) {
| QStringList list = QStringList::split( QChar(' '), _description );
| for( QStringList::Iterator it = list.begin(); it != list.end();
| ++it ) {
| ok &= ( txt.find( *it, 0, false ) != -1 );
| }
| }
|
| return ok;
|
| The code finds all images with the descriptions being searched for plus
| all images with *no* description.
|
| Maybe this could help and is quite fast.
|
| QString txt = info->description();
| + if ( !_description.isEmpty() && txt.isEmpty() ) {
| + ok = false;
| + }
| if ( !txt.isEmpty() ) {
| QStringList list = QStringList::split( QChar(' '), _description );
| for( QStringList::Iterator it = list.begin(); it != list.end();
| ++it ) {
| ok &= ( txt.find( *it, 0, false ) != -1 );
| }
| }
|
| return ok;
|
| Cheers,
| Christoph
| _______________________________________________
| KPhotoAlbum mailing list
| KPhotoAlbum at kdab.net
| http://mail.kdab.net/mailman/listinfo/kphotoalbum
--
Having trouble finding a given image in your collection containing
thousands of images?
http://www.kphotoalbum.org might be the answer.
More information about the Kphotoalbum
mailing list