summaryrefslogtreecommitdiffabout
path: root/kabc/vcard
Unidiff
Diffstat (limited to 'kabc/vcard') (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/vcard/ContentLine.cpp10
-rw-r--r--kabc/vcard/VCardv.cpp12
-rw-r--r--kabc/vcard/include/VCardDefines.h3
3 files changed, 18 insertions, 7 deletions
diff --git a/kabc/vcard/ContentLine.cpp b/kabc/vcard/ContentLine.cpp
index 0fb5b5d..f7e04a9 100644
--- a/kabc/vcard/ContentLine.cpp
+++ b/kabc/vcard/ContentLine.cpp
@@ -57,25 +57,28 @@
57 57
58#include <VCardRToken.h> 58#include <VCardRToken.h>
59#include <VCardContentLine.h> 59#include <VCardContentLine.h>
60 60
61#include <VCardEntity.h> 61#include <VCardEntity.h>
62#include <VCardEnum.h> 62#include <VCardEnum.h>
63#include <VCardDefines.h> 63#include <VCardDefines.h>
64 64
65using namespace VCARD; 65using namespace VCARD;
66 66
67ContentLine::ContentLine() 67ContentLine::ContentLine()
68 :Entity(), 68 :Entity(),
69 value_(0) 69 value_(0),
70 paramType_( ParamUnknown ),
71 valueType_( ValueUnknown ),
72 entityType_( EntityUnknown )
70{ 73{
71 paramList_.setAutoDelete( TRUE ); 74 paramList_.setAutoDelete( TRUE );
72} 75}
73 76
74ContentLine::ContentLine(const ContentLine & x) 77ContentLine::ContentLine(const ContentLine & x)
75 :Entity(x), 78 :Entity(x),
76 group_ (x.group_), 79 group_ (x.group_),
77 name_ (x.name_), 80 name_ (x.name_),
78 /*US paramList_(x.paramList_),*/ 81 /*US paramList_(x.paramList_),*/
79 value_(x.value_->clone()), 82 value_(x.value_->clone()),
80 paramType_(x.paramType_), 83 paramType_(x.paramType_),
81 valueType_(x.valueType_), 84 valueType_(x.valueType_),
@@ -88,25 +91,28 @@ ContentLine::ContentLine(const ContentLine & x)
88 for (; it.current(); ++it) 91 for (; it.current(); ++it)
89 { 92 {
90 Param *p = new Param; 93 Param *p = new Param;
91 p->setName( it.current()->name() ); 94 p->setName( it.current()->name() );
92 p->setValue( it.current()->value() ); 95 p->setValue( it.current()->value() );
93 paramList_.append(p); 96 paramList_.append(p);
94 } 97 }
95 98
96} 99}
97 100
98ContentLine::ContentLine(const QCString & s) 101ContentLine::ContentLine(const QCString & s)
99 :Entity(s), 102 :Entity(s),
100 value_(0) 103 value_(0),
104 paramType_( ParamUnknown ),
105 valueType_( ValueUnknown ),
106 entityType_( EntityUnknown )
101{ 107{
102 paramList_.setAutoDelete( TRUE ); 108 paramList_.setAutoDelete( TRUE );
103} 109}
104 110
105 ContentLine & 111 ContentLine &
106ContentLine::operator = (ContentLine & x) 112ContentLine::operator = (ContentLine & x)
107{ 113{
108 if (*this == x) return *this; 114 if (*this == x) return *this;
109 115
110 ParamListIterator it(x.paramList_); 116 ParamListIterator it(x.paramList_);
111 for (; it.current(); ++it) 117 for (; it.current(); ++it)
112 { 118 {
diff --git a/kabc/vcard/VCardv.cpp b/kabc/vcard/VCardv.cpp
index 391a69e..d19a004 100644
--- a/kabc/vcard/VCardv.cpp
+++ b/kabc/vcard/VCardv.cpp
@@ -179,31 +179,35 @@ VCard::_parse()
179 cur += it.current() + 1; 179 cur += it.current() + 1;
180 ++it; 180 ++it;
181 } 181 }
182 182
183 --it; 183 --it;
184 184
185 refolded.append(cur); 185 refolded.append(cur);
186 } 186 }
187 187
188 QStrListIterator it2(refolded); 188 QStrListIterator it2(refolded);
189 189
190 for (; it2.current(); ++it2) { 190 for (; it2.current(); ++it2) {
191 191 vDebug("New contentline using \"" + QCString(it2.current()) + "\"");
192 vDebug("New contentline using \"" + QCString(it2.current()) + "\"");
193 ContentLine * cl = new ContentLine(it2.current()); 192 ContentLine * cl = new ContentLine(it2.current());
194 193
195 cl->parse(); 194 cl->parse();
196 195 if (cl->value() == 0)
197 contentLineList_.append(cl); 196 {
197 qDebug("Content line could not be parsed. Discarded: %s" + QCString(it2.current()));
198 delete cl;
199 }
200 else
201 contentLineList_.append(cl);
198 } 202 }
199 203
200 /////////////////////////////////////////////////////////////// 204 ///////////////////////////////////////////////////////////////
201 // LAST LINE 205 // LAST LINE
202 206
203 split = endLine.find(':'); 207 split = endLine.find(':');
204 208
205 if (split == -1) // invalid, no END 209 if (split == -1) // invalid, no END
206 return; 210 return;
207 211
208 firstPart = endLine.left(split); 212 firstPart = endLine.left(split);
209 valuePart = endLine.right(firstPart.length() - split - 1); 213 valuePart = endLine.right(firstPart.length() - split - 1);
diff --git a/kabc/vcard/include/VCardDefines.h b/kabc/vcard/include/VCardDefines.h
index dd38ae2..557410f 100644
--- a/kabc/vcard/include/VCardDefines.h
+++ b/kabc/vcard/include/VCardDefines.h
@@ -18,25 +18,26 @@
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/ 22*/
23 23
24#ifndef VCARD_DEFINES_H 24#ifndef VCARD_DEFINES_H
25#define VCARD_DEFINES_H 25#define VCARD_DEFINES_H
26 26
27#include <kdebug.h> 27#include <kdebug.h>
28 28
29#ifdef VCARD_DEBUG 29#ifdef VCARD_DEBUG
30#define vDebug(a) kdDebug(5710) << a << endl; 30//US #define vDebug(a) kdDebug(5710) << a << endl;
31#define vDebug(a) qDebug(a);
31#else 32#else
32#define vDebug(a) 33#define vDebug(a)
33#endif 34#endif
34 35
35#if 0 36#if 0
36#ifndef NDEBUG 37#ifndef NDEBUG
37 #include <qcstring.h> 38 #include <qcstring.h>
38 #include <iostream> 39 #include <iostream>
39 #ifdef __GNUG__ 40 #ifdef __GNUG__
40 # define vDebug(a) cerr << className() << ":" << __FUNCTION__ << " (" \ 41 # define vDebug(a) cerr << className() << ":" << __FUNCTION__ << " (" \
41 << __LINE__ << "): " << QCString((a)).data() << endl; 42 << __LINE__ << "): " << QCString((a)).data() << endl;
42 #else 43 #else