[prev in list] [next in list] [prev in thread] [next in thread]
List: kwrite-devel
Subject: Re: Modes
From: Sebastian Pipping <webmaster () hartwork ! org>
Date: 2007-07-06 22:41:40
Message-ID: 468EC524.9000909 () hartwork ! org
[Download RAW message or body]
Dominik Haumann wrote:
> QString KateModeManager::wildcardsFind (const QString &fileName)
> {
> QList<KateFileType*> types;
>
> foreach (KateFileType *type, m_types)
> {
> foreach (QString wildcard, type->wildcards)
> {
> // anders: we need to be sure to match the end of string, as eg a css
> file
> // would otherwise end up with the c hl
> QRegExp re(wildcard, Qt::CaseSensitive, QRegExp::Wildcard);
> if ( ( re.indexIn( fileName ) > -1 ) && ( re.matchedLength() ==
> (int)fileName.length() ) )
> types.append (type);
> }
> }
> [...]
---------------------------------------------------------------
In case we stick with the above code - could moving the
QRegExp object creation out of the loop speed this thing up?
That way it would only be re-initialized and not re-created.
Sebastian
_______________________________________________
KWrite-Devel mailing list
KWrite-Devel@kde.org
https://mail.kde.org/mailman/listinfo/kwrite-devel
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic