The filters for the layout combo and document class combo share a
problem: If you type "beam", e.g, in the latter case, then we will
show any document class that contains those letters, in that order,
but not necessarily consecutively. This is extremely confusing and,
as José put it, just weird. So let's fix it.
I'd call this a bug so would be happy to see this in stable, too.
static QString charFilterRegExpCC(QString const & filter)
{
- QString re;
+ QString re = ".*";
for (int i = 0; i < filter.length(); ++i) {
QChar c = filter[i];
if (c.isLower())
- re += ".*[" + QRegExp::escape(c) + QRegExp::escape(c.toUpper()) + "]";
+ re += "[" + QRegExp::escape(c) + QRegExp::escape(c.toUpper()) + "]";
else
- re += ".*" + QRegExp::escape(c);
+ re += QRegExp::escape(c);
}
return re;
}
static QString charFilterRegExp(QString const & filter)
{
- QString re;
+ QString re = ".*";
for (int i = 0; i < filter.length(); ++i) {
QChar c = filter[i];
if (c.isLower())
- re += ".*[" + QRegExp::escape(c) + QRegExp::escape(c.toUpper()) + "]";
+ re += "["+ QRegExp::escape(c) + QRegExp::escape(c.toUpper()) + "]";
else
- re += ".*" + QRegExp::escape(c);
+ re += QRegExp::escape(c);
}
return re;
}