-rw-r--r-- | kabc/vcard/VCardEntity.cpp | 23 |
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 | |||
@@ -2,7 +2,7 @@ | |||
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 |
@@ -31,16 +31,19 @@ using namespace VCARD; | |||
31 | VCardEntity::VCardEntity() | 31 | VCardEntity::VCardEntity() |
32 | :Entity() | 32 | :Entity() |
33 | { | 33 | { |
34 | cardList_.setAutoDelete( TRUE ); | ||
34 | } | 35 | } |
35 | 36 | ||
36 | VCardEntity::VCardEntity(const VCardEntity & x) | 37 | VCardEntity::VCardEntity(const VCardEntity & x) |
37 | :Entity(x) | 38 | :Entity(x) |
38 | { | 39 | { |
40 | cardList_.setAutoDelete( TRUE ); | ||
39 | } | 41 | } |
40 | 42 | ||
41 | VCardEntity::VCardEntity(const QCString & s) | 43 | VCardEntity::VCardEntity(const QCString & s) |
42 | :Entity(s) | 44 | :Entity(s) |
43 | { | 45 | { |
46 | cardList_.setAutoDelete( TRUE ); | ||
44 | } | 47 | } |
45 | 48 | ||
46 | VCardEntity & | 49 | VCardEntity & |
@@ -75,21 +78,21 @@ VCardEntity::_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 | } |
@@ -98,7 +101,7 @@ VCardEntity::_parse() | |||
98 | VCardEntity::_assemble() | 101 | VCardEntity::_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 | } |