summaryrefslogtreecommitdiffabout
path: root/kabc
authorzautrix <zautrix>2004-10-22 16:36:13 (UTC)
committer zautrix <zautrix>2004-10-22 16:36:13 (UTC)
commit60be6d741f579b0f368ea9d0d4327abcadb44d07 (patch) (unidiff)
tree924fd9d2a541b66fc18f91e9264b5a3d66c4c969 /kabc
parent7afbe9769c1c6b3f7657c1cedcdc19a9447508ce (diff)
downloadkdepimpi-60be6d741f579b0f368ea9d0d4327abcadb44d07.zip
kdepimpi-60be6d741f579b0f368ea9d0d4327abcadb44d07.tar.gz
kdepimpi-60be6d741f579b0f368ea9d0d4327abcadb44d07.tar.bz2
updated whats new
Diffstat (limited to 'kabc') (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/vcard/VCardEntity.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/kabc/vcard/VCardEntity.cpp b/kabc/vcard/VCardEntity.cpp
index 81debf4..a2ff327 100644
--- a/kabc/vcard/VCardEntity.cpp
+++ b/kabc/vcard/VCardEntity.cpp
@@ -1,121 +1,121 @@
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:
12 12
13 The above copyright notice and this permission notice shall be included in 13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software. 14 all copies or substantial portions of the Software.
15 15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
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#include <qregexp.h> 24#include <qregexp.h>
25#include <qdatetime.h>; 25#include <qdatetime.h>
26 26
27#include <VCardDefines.h> 27#include <VCardDefines.h>
28#include <VCardVCardEntity.h> 28#include <VCardVCardEntity.h>
29 29
30using namespace VCARD; 30using namespace VCARD;
31 31
32VCardEntity::VCardEntity() 32VCardEntity::VCardEntity()
33 :Entity() 33 :Entity()
34{ 34{
35 cardList_.setAutoDelete( TRUE ); 35 cardList_.setAutoDelete( TRUE );
36} 36}
37 37
38VCardEntity::VCardEntity(const VCardEntity & x) 38VCardEntity::VCardEntity(const VCardEntity & x)
39 :Entity(x) 39 :Entity(x)
40{ 40{
41 cardList_.setAutoDelete( TRUE ); 41 cardList_.setAutoDelete( TRUE );
42} 42}
43 43
44VCardEntity::VCardEntity(const QCString & s) 44VCardEntity::VCardEntity(const QCString & s)
45 :Entity(s) 45 :Entity(s)
46{ 46{
47 cardList_.setAutoDelete( TRUE ); 47 cardList_.setAutoDelete( TRUE );
48} 48}
49 49
50 VCardEntity & 50 VCardEntity &
51VCardEntity::operator = (VCardEntity & x) 51VCardEntity::operator = (VCardEntity & x)
52{ 52{
53 if (*this == x) return *this; 53 if (*this == x) return *this;
54 54
55 Entity::operator = (x); 55 Entity::operator = (x);
56 return *this; 56 return *this;
57} 57}
58 58
59 VCardEntity & 59 VCardEntity &
60VCardEntity::operator = (const QCString & s) 60VCardEntity::operator = (const QCString & s)
61{ 61{
62 Entity::operator = (s); 62 Entity::operator = (s);
63 return *this; 63 return *this;
64} 64}
65 65
66 bool 66 bool
67VCardEntity::operator == (VCardEntity & x) 67VCardEntity::operator == (VCardEntity & x)
68{ 68{
69 x.parse(); 69 x.parse();
70 return false; 70 return false;
71} 71}
72 72
73VCardEntity::~VCardEntity() 73VCardEntity::~VCardEntity()
74{ 74{
75} 75}
76 76
77 void 77 void
78VCardEntity::_parse() 78VCardEntity::_parse()
79{ 79{
80#if 0 80#if 0
81 QTime tim; 81 QTime tim;
82 tim.start(); 82 tim.start();
83 int num = 0; 83 int num = 0;
84 // old code 84 // old code
85 vDebug("parse"); 85 vDebug("parse");
86 QCString s(strRep_); 86 QCString s(strRep_);
87 87
88 int i = s.find(QRegExp("BEGIN:VCARD", false)); 88 int i = s.find(QRegExp("BEGIN:VCARD", false));
89 89
90 while (i != -1) { 90 while (i != -1) {
91 91
92 i = s.find(QRegExp("BEGIN:VCARD", false), 11); 92 i = s.find(QRegExp("BEGIN:VCARD", false), 11);
93 93
94 QCString cardStr(s.left(i)); 94 QCString cardStr(s.left(i));
95 95
96 VCard * v = new VCard(cardStr); 96 VCard * v = new VCard(cardStr);
97 97
98 cardList_.append(v); 98 cardList_.append(v);
99 99
100 v->parse(); 100 v->parse();
101 101
102 s.remove(0, i); 102 s.remove(0, i);
103 } 103 }
104 104
105#else 105#else
106 // this code is up to 17 (!) times faster 106 // this code is up to 17 (!) times faster
107 int start = 0; 107 int start = 0;
108 QTime tim; 108 QTime tim;
109 tim.start(); 109 tim.start();
110 int i = 11; 110 int i = 11;
111 int len = strRep_.length(); 111 int len = strRep_.length();
112 int num = 0; 112 int num = 0;
113 while (i < len ) { 113 while (i < len ) {
114 while( i < len ) { 114 while( i < len ) {
115 int add = 1; 115 int add = 1;
116 if ( strRep_.at(i) == 'B' ) { 116 if ( strRep_.at(i) == 'B' ) {
117 if ( i+add < len && strRep_.at(i+add++) == 'E') 117 if ( i+add < len && strRep_.at(i+add++) == 'E')
118 if ( i+add < len && strRep_.at(i+add++) == 'G') 118 if ( i+add < len && strRep_.at(i+add++) == 'G')
119 if ( i+add < len && strRep_.at(i+add++) == 'I') 119 if ( i+add < len && strRep_.at(i+add++) == 'I')
120 if ( i+add < len && strRep_.at(i+add++) == 'N') 120 if ( i+add < len && strRep_.at(i+add++) == 'N')
121 if ( i+add < len && strRep_.at(i+add++) == ':') 121 if ( i+add < len && strRep_.at(i+add++) == ':')