summaryrefslogtreecommitdiff
path: root/noncore/net/mailit/textparser.cpp
authorgroucho <groucho>2003-04-24 11:19:11 (UTC)
committer groucho <groucho>2003-04-24 11:19:11 (UTC)
commit9671975e21266e3bfa6f3c793a3278b67cea34b7 (patch) (side-by-side diff)
tree876c77939cfd0e00fc844b1b5af09b2978564a6d /noncore/net/mailit/textparser.cpp
parent51e782b9658de61dc02579e115a9c62f396609a3 (diff)
downloadopie-9671975e21266e3bfa6f3c793a3278b67cea34b7.zip
opie-9671975e21266e3bfa6f3c793a3278b67cea34b7.tar.gz
opie-9671975e21266e3bfa6f3c793a3278b67cea34b7.tar.bz2
- 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
Diffstat (limited to 'noncore/net/mailit/textparser.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mailit/textparser.cpp40
1 files changed, 25 insertions, 15 deletions
diff --git a/noncore/net/mailit/textparser.cpp b/noncore/net/mailit/textparser.cpp
index f082417..3fa5f6e 100644
--- a/noncore/net/mailit/textparser.cpp
+++ b/noncore/net/mailit/textparser.cpp
@@ -64,18 +64,29 @@ 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++;
@@ -84,3 +95,2 @@ int TextParser::find(QString target, QChar sep, int pos, bool upperCase)
}
-
return -1;