save a write lock and return false (as we don't actually add anything) on addMatches with null items

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=772448
This commit is contained in:
Aaron J. Seigo 2008-02-08 19:10:20 +00:00
parent 253f892b99
commit 293a4dc07d

View File

@ -280,6 +280,13 @@ bool SearchContext::addMatches( const QString& term, const QList<SearchMatch *>
if (searchTerm() != term) {
return false;
}
if (exactMatches.isEmpty() &&
possibleMatches.isEmpty() &&
informationalMatches.isEmpty()) {
return false;
}
d->lockForWrite();
d->exact << exactMatches;
d->possible << possibleMatches;