summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-01-15 09:31:52 (UTC)
committer zautrix <zautrix>2005-01-15 09:31:52 (UTC)
commitf9f60d23806530a5bccae372e5eeebee6d528f20 (patch) (unidiff)
treecaa83ca3e29a14a3423a6f4a7f22119148eaef04
parenta423c235d0cbc39292102042ed8f4a953e0e37f9 (diff)
downloadkdepimpi-f9f60d23806530a5bccae372e5eeebee6d528f20.zip
kdepimpi-f9f60d23806530a5bccae372e5eeebee6d528f20.tar.gz
kdepimpi-f9f60d23806530a5bccae372e5eeebee6d528f20.tar.bz2
crash fix
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--kabc/vcard/VCardv.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/kabc/vcard/VCardv.cpp b/kabc/vcard/VCardv.cpp
index 49bfe43..1166aac 100644
--- a/kabc/vcard/VCardv.cpp
+++ b/kabc/vcard/VCardv.cpp
@@ -100,49 +100,49 @@ VCard::~VCard()
100VCard::_parse() 100VCard::_parse()
101{ 101{
102 102
103 QStringList l; 103 QStringList l;
104 QStrList sl; 104 QStrList sl;
105 105
106 RTokenise(strRep_, "\r\n", sl); 106 RTokenise(strRep_, "\r\n", sl);
107 107
108 if (sl.count() < 3) { // Invalid VCARD ! 108 if (sl.count() < 3) { // Invalid VCARD !
109 //qDebug("invalid vcard "); 109 //qDebug("invalid vcard ");
110 return; 110 return;
111 } 111 }
112 l = QStringList::fromStrList( sl ); 112 l = QStringList::fromStrList( sl );
113 // Get the first line 113 // Get the first line
114 QString beginLine = l[0].stripWhiteSpace(); 114 QString beginLine = l[0].stripWhiteSpace();
115 115
116 // Remove extra blank lines 116 // Remove extra blank lines
117 while (l.last().isEmpty()) 117 while (l.last().isEmpty())
118 l.remove(l.last()); 118 l.remove(l.last());
119 119
120 // Now we know this is the last line 120 // Now we know this is the last line
121 QString endLine = l.last(); 121 QString endLine = l.last();
122 122
123 // Trash the first and last lines as we have seen them. 123 // Trash the first and last lines as we have seen them.
124 l.remove(l.first()); 124 l.remove(l.begin());
125 l.remove(l.last()); 125 l.remove(l.last());
126 126
127 /////////////////////////////////////////////////////////////// 127 ///////////////////////////////////////////////////////////////
128 // FIRST LINE 128 // FIRST LINE
129 129
130 int split = beginLine.find(':'); 130 int split = beginLine.find(':');
131 131
132 if (split == -1) { // invalid, no BEGIN 132 if (split == -1) { // invalid, no BEGIN
133 vDebug("No split"); 133 vDebug("No split");
134 return; 134 return;
135 } 135 }
136 136
137 QString firstPart(beginLine.left(split)); 137 QString firstPart(beginLine.left(split));
138 QString valuePart(beginLine.mid(split + 1)); 138 QString valuePart(beginLine.mid(split + 1));
139 139
140 split = firstPart.find('.'); 140 split = firstPart.find('.');
141 141
142 if (split != -1) { 142 if (split != -1) {
143 group_ = firstPart.left(split); 143 group_ = firstPart.left(split);
144 firstPart= firstPart.right(firstPart.length() - split - 1); 144 firstPart= firstPart.right(firstPart.length() - split - 1);
145 } 145 }
146 146
147 if (firstPart.left(5) != "BEGIN" ) { // No BEGIN ! 147 if (firstPart.left(5) != "BEGIN" ) { // No BEGIN !
148 qDebug("no BEGIN in vcard "); 148 qDebug("no BEGIN in vcard ");