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
@@ -72,30 +72,52 @@ bool PhoneNumber::simplifyNumber()
72 int i; 72 int i;
73 Number = mNumber.stripWhiteSpace (); 73 Number = mNumber.stripWhiteSpace ();
74 mNumber = ""; 74 mNumber = "";
75 for ( i = 0; i < Number.length(); ++i) { 75 for ( i = 0; i < Number.length(); ++i) {
76 if ( Number.at(i).isDigit() || Number.at(i) == '+'|| Number.at(i) == '*'|| Number.at(i) == '#' ) 76 if ( Number.at(i).isDigit() || Number.at(i) == '+'|| Number.at(i) == '*'|| Number.at(i) == '#' )
77 mNumber += Number.at(i); 77 mNumber += Number.at(i);
78 } 78 }
79 return ( mNumber.length() > 0 ); 79 return ( mNumber.length() > 0 );
80} 80}
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;
93} 115}
94 116
95QString PhoneNumber::id() const 117QString PhoneNumber::id() const
96{ 118{
97 return mId; 119 return mId;
98} 120}
99 121
100void PhoneNumber::setNumber( const QString &number ) 122void PhoneNumber::setNumber( const QString &number )
101{ 123{