summaryrefslogtreecommitdiffabout
path: root/kabc/phonenumber.cpp
authorzautrix <zautrix>2004-10-13 12:38:18 (UTC)
committer zautrix <zautrix>2004-10-13 12:38:18 (UTC)
commitefdd0735bda81dcd82dfb6d6dc0d0c143f249336 (patch) (unidiff)
tree8d67e4b51fbc3e8c48e1656c78054cfe6d2ead66 /kabc/phonenumber.cpp
parentf22ee1ec902fe2fc610786f39049fb84542b8726 (diff)
downloadkdepimpi-efdd0735bda81dcd82dfb6d6dc0d0c143f249336.zip
kdepimpi-efdd0735bda81dcd82dfb6d6dc0d0c143f249336.tar.gz
kdepimpi-efdd0735bda81dcd82dfb6d6dc0d0c143f249336.tar.bz2
mege contact fixes
Diffstat (limited to 'kabc/phonenumber.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/phonenumber.cpp32
1 files changed, 27 insertions, 5 deletions
diff --git a/kabc/phonenumber.cpp b/kabc/phonenumber.cpp
index d7e3925..3d82553 100644
--- a/kabc/phonenumber.cpp
+++ b/kabc/phonenumber.cpp
@@ -81,12 +81,34 @@ bool PhoneNumber::simplifyNumber()
81// make cellphone compatible 81// make cellphone compatible
82void PhoneNumber::simplifyType() 82void PhoneNumber::simplifyType()
83{ 83{
84 if ( mType & Fax ) mType = Fax; 84 if ( mType & Fax ) mType = Fax;
85 else if ( mType & Cell ) mType = Cell; 85 else if ( mType & Cell ) mType = Cell;
86 else if ( mType & Work ) mType = Work ; 86 else if ( mType & Work ) mType = Work ;
87 else if ( mType & Home ) mType = Home; 87 else if ( mType & Home ) mType = Home;
88 else mType = Pref; 88 else mType = Pref;
89} 89}
90bool PhoneNumber::contains( const PhoneNumber &p )
91{
92 QString Number;
93 QString Num;
94 uint i;
95 Number = mNumber.stripWhiteSpace ();
96 Num = "";
97 for ( i = 0; i < Number.length(); ++i) {
98 if ( Number.at(i).isDigit() || Number.at(i) == '+'|| Number.at(i) == '*'|| Number.at(i) == '#' )
99 Num += Number.at(i);
100 }
101 QString NumberR;
102 QString NumR;
103 NumberR = p.mNumber.stripWhiteSpace ();
104 NumR = "";
105 for ( i = 0; i < NumberR.length(); ++i) {
106 if ( NumberR.at(i).isDigit() || NumberR.at(i) == '+'|| NumberR.at(i) == '*'|| NumberR.at(i) == '#' )
107 NumR += NumberR.at(i);
108 }
109 return (Num == NumR);
110}
111
90void PhoneNumber::setId( const QString &id ) 112void PhoneNumber::setId( const QString &id )
91{ 113{
92 mId = id; 114 mId = id;