diff options
author | Mike FABIAN <mike.fabian@basyskom.de> | 2010-09-13 15:07:43 +0200 |
---|---|---|
committer | Mike FABIAN <mike.fabian@basyskom.de> | 2010-09-14 10:33:50 +0200 |
commit | d9c0dbc8af27de1f5c7c19d90f8355f5380de3ee (patch) | |
tree | 3c2febe16543b977a16b8ea0e34b495f72aa55b9 /src/corelib/i18n | |
parent | d510899975aa98b761a4930cd6c6b69dabe81fbc (diff) |
Changes: fix coverity issue 1144
RevBy: Holger Schröder
Details:
Do not create the QStringMatcher object on the stack.
Diffstat (limited to 'src/corelib/i18n')
-rw-r--r-- | src/corelib/i18n/mlocationdatabase.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/corelib/i18n/mlocationdatabase.cpp b/src/corelib/i18n/mlocationdatabase.cpp index e2b2aa54..6b98f271 100644 --- a/src/corelib/i18n/mlocationdatabase.cpp +++ b/src/corelib/i18n/mlocationdatabase.cpp @@ -256,14 +256,15 @@ QList<MCity> MLocationDatabase::matchingCities(const QString& searchString) Q_D(MLocationDatabase); QList<MCity> list; - QStringMatcher matcher(searchString, Qt::CaseInsensitive); + QStringMatcher *matcher = new QStringMatcher(searchString, Qt::CaseInsensitive); foreach (const MCity &city, d->cities) { - if (matcher.indexIn(city.englishName()) != -1 - || matcher.indexIn(city.localName()) != -1) + if (matcher->indexIn(city.englishName()) != -1 + || matcher->indexIn(city.localName()) != -1) { list.append( city ); } } + delete matcher; return list; } |