summaryrefslogtreecommitdiffabout
path: root/kabc/vcard/VCardEntity.cpp
Unidiff
Diffstat (limited to 'kabc/vcard/VCardEntity.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/vcard/VCardEntity.cpp23
1 files changed, 13 insertions, 10 deletions
diff --git a/kabc/vcard/VCardEntity.cpp b/kabc/vcard/VCardEntity.cpp
index 0c21e2f..0cd2086 100644
--- a/kabc/vcard/VCardEntity.cpp
+++ b/kabc/vcard/VCardEntity.cpp
@@ -1,11 +1,11 @@
1/* 1/*
2 libvcard - vCard parsing library for vCard version 3.0 2 libvcard - vCard parsing library for vCard version 3.0
3 3
4 Copyright (C) 1998 Rik Hemsley rik@kde.org 4 Copyright (C) 1998 Rik Hemsley rik@kde.org
5 5
6 Permission is hereby granted, free of charge, to any person obtaining a copy 6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to 7 of this software and associated documentation files (the "Software"), to
8 deal in the Software without restriction, including without limitation the 8 deal in the Software without restriction, including without limitation the
9 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 9 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 sell copies of the Software, and to permit persons to whom the Software is 10 sell copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions: 11 furnished to do so, subject to the following conditions:
@@ -28,22 +28,25 @@
28 28
29using namespace VCARD; 29using namespace VCARD;
30 30
31VCardEntity::VCardEntity() 31VCardEntity::VCardEntity()
32 :Entity() 32 :Entity()
33{ 33{
34 cardList_.setAutoDelete( TRUE );
34} 35}
35 36
36VCardEntity::VCardEntity(const VCardEntity & x) 37VCardEntity::VCardEntity(const VCardEntity & x)
37 :Entity(x) 38 :Entity(x)
38{ 39{
40 cardList_.setAutoDelete( TRUE );
39} 41}
40 42
41VCardEntity::VCardEntity(const QCString & s) 43VCardEntity::VCardEntity(const QCString & s)
42 :Entity(s) 44 :Entity(s)
43{ 45{
46 cardList_.setAutoDelete( TRUE );
44} 47}
45 48
46 VCardEntity & 49 VCardEntity &
47VCardEntity::operator = (VCardEntity & x) 50VCardEntity::operator = (VCardEntity & x)
48{ 51{
49 if (*this == x) return *this; 52 if (*this == x) return *this;
@@ -72,36 +75,36 @@ VCardEntity::~VCardEntity()
72 75
73 void 76 void
74VCardEntity::_parse() 77VCardEntity::_parse()
75{ 78{
76 vDebug("parse"); 79 vDebug("parse");
77 QCString s(strRep_); 80 QCString s(strRep_);
78 81
79 int i = s.find(QRegExp("BEGIN:VCARD", false)); 82 int i = s.find(QRegExp("BEGIN:VCARD", false));
80 83
81 while (i != -1) { 84 while (i != -1) {
82 85
83 i = s.find(QRegExp("BEGIN:VCARD", false), 11); 86 i = s.find(QRegExp("BEGIN:VCARD", false), 11);
84 87
85 QCString cardStr(s.left(i)); 88 QCString cardStr(s.left(i));
86 89
87 VCard * v = new VCard(cardStr); 90 VCard * v = new VCard(cardStr);
88 91
89 cardList_.append(v); 92 cardList_.append(v);
90 93
91 v->parse(); 94 v->parse();
92 95
93 s.remove(0, i); 96 s.remove(0, i);
94 } 97 }
95} 98}
96 99
97 void 100 void
98VCardEntity::_assemble() 101VCardEntity::_assemble()
99{ 102{
100 VCardListIterator it(cardList_); 103 VCardListIterator it(cardList_);
101 104
102 for (; it.current(); ++it) 105 for (; it.current(); ++it)
103 strRep_ += it.current()->asString() + "\r\n"; // One CRLF for luck. 106 strRep_ += it.current()->asString() + "\r\n"; // One CRLF for luck.
104} 107}
105 108
106 VCardList & 109 VCardList &
107VCardEntity::cardList() 110VCardEntity::cardList()