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) (side-by-side diff)
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
@@ -82,10 +82,32 @@ bool PhoneNumber::simplifyNumber()
void PhoneNumber::simplifyType()
{
- if ( mType & Fax ) mType = Fax;
- else if ( mType & Cell ) mType = Cell;
- else if ( mType & Work ) mType = Work ;
- else if ( mType & Home ) mType = Home;
- else mType = Pref;
+ if ( mType & Fax ) mType = Fax;
+ else if ( mType & Cell ) mType = Cell;
+ else if ( mType & Work ) mType = Work ;
+ else if ( mType & Home ) mType = Home;
+ else mType = Pref;
}
+bool PhoneNumber::contains( const PhoneNumber &p )
+{
+ QString Number;
+ QString Num;
+ uint i;
+ Number = mNumber.stripWhiteSpace ();
+ Num = "";
+ for ( i = 0; i < Number.length(); ++i) {
+ if ( Number.at(i).isDigit() || Number.at(i) == '+'|| Number.at(i) == '*'|| Number.at(i) == '#' )
+ Num += Number.at(i);
+ }
+ QString NumberR;
+ QString NumR;
+ NumberR = p.mNumber.stripWhiteSpace ();
+ NumR = "";
+ for ( i = 0; i < NumberR.length(); ++i) {
+ if ( NumberR.at(i).isDigit() || NumberR.at(i) == '+'|| NumberR.at(i) == '*'|| NumberR.at(i) == '#' )
+ NumR += NumberR.at(i);
+ }
+ return (Num == NumR);
+}
+
void PhoneNumber::setId( const QString &id )
{