summaryrefslogtreecommitdiff
path: root/noncore/net/mailit/textparser.cpp
Unidiff
Diffstat (limited to 'noncore/net/mailit/textparser.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/net/mailit/textparser.cpp36
1 files changed, 23 insertions, 13 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
@@ -62,27 +62,37 @@ void TextParser::createSeparators()
62 /*Returns pos of given search criteria, -1 if not found */ 62 /*Returns pos of given search criteria, -1 if not found */
63int TextParser::find(QString target, QChar sep, int pos, bool upperCase) 63int TextParser::find(QString target, QChar sep, int pos, bool upperCase)
64{ 64{
65
66 t_splitElm parsstr;
67 QString pString;
68
65 int atLine = 0, atPosElm = 0; 69 int atLine = 0, atPosElm = 0;
66 70
67 for (int x = 0; x < totalElmCount; x++) { 71 getLineReference(pos,&atLine,&atPosElm);
68 if (x >= pos) { 72
69 if (upperCase) { 73 for (int x = pos; x < totalElmCount; x++)
70 if ((splitDone[atLine].elm[atPosElm].str.upper() == target) && 74 {
71 (splitDone[atLine].elm[atPosElm].separator == sep)) 75 parsstr=splitDone[atLine].elm[atPosElm++];
72 return x; 76
73 } else { 77 if (upperCase)
74 if ((splitDone[atLine].elm[atPosElm].str == target) && 78 {
75 (splitDone[atLine].elm[atPosElm].separator == sep)) 79 pString=parsstr.str.upper();
76 return x; 80 target=target.upper();
77 } 81 }
82 else
83 {
84 pString=parsstr.str;
78 } 85 }
79 atPosElm++; 86 if ((pString == target) && (parsstr.separator == sep))
80 if (atPosElm >= splitDone[atLine].elmCount) { //new Line 87 {
88 return x;
89 }
90 if (atPosElm >= splitDone[atLine].elmCount)
91 { //new Line
81 atLine++; 92 atLine++;
82 atPosElm = 0; 93 atPosElm = 0;
83 } 94 }
84 } 95 }
85
86 return -1; 96 return -1;
87} 97}
88 98