From 9671975e21266e3bfa6f3c793a3278b67cea34b7 Mon Sep 17 00:00:00 2001 From: groucho Date: Thu, 24 Apr 2003 11:19:11 +0000 Subject: - reworked size filtering - started reworking offline download - better tab focus switching - Hello "Whats this" capability - Fixed parsing of To: header files (no more Delivered-To: and Reply-To: matches) - Good bye Settings.txt, hello Config Objects and encrypted passwords - Translation improvements (added trs) - Parser optimizations --- (limited to 'noncore/unsupported/mailit/textparser.cpp') diff --git a/noncore/unsupported/mailit/textparser.cpp b/noncore/unsupported/mailit/textparser.cpp index f082417..3fa5f6e 100644 --- a/noncore/unsupported/mailit/textparser.cpp +++ b/noncore/unsupported/mailit/textparser.cpp @@ -62,27 +62,37 @@ void TextParser::createSeparators() /* Returns pos of given search criteria, -1 if not found */ int TextParser::find(QString target, QChar sep, int pos, bool upperCase) { + + t_splitElm parsstr; + QString pString; + int atLine = 0, atPosElm = 0; - for (int x = 0; x < totalElmCount; x++) { - if (x >= pos) { - if (upperCase) { - if ((splitDone[atLine].elm[atPosElm].str.upper() == target) && - (splitDone[atLine].elm[atPosElm].separator == sep)) - return x; - } else { - if ((splitDone[atLine].elm[atPosElm].str == target) && - (splitDone[atLine].elm[atPosElm].separator == sep)) - return x; - } - } - atPosElm++; - if (atPosElm >= splitDone[atLine].elmCount) { //new Line + getLineReference(pos,&atLine,&atPosElm); + + for (int x = pos; x < totalElmCount; x++) + { + parsstr=splitDone[atLine].elm[atPosElm++]; + + if (upperCase) + { + pString=parsstr.str.upper(); + target=target.upper(); + } + else + { + pString=parsstr.str; + } + if ((pString == target) && (parsstr.separator == sep)) + { + return x; + } + if (atPosElm >= splitDone[atLine].elmCount) + { //new Line atLine++; atPosElm = 0; } } - return -1; } -- cgit v0.9.0.2