summaryrefslogtreecommitdiffabout
path: root/kabc/phonenumber.cpp
authorzautrix <zautrix>2004-10-08 20:03:23 (UTC)
committer zautrix <zautrix>2004-10-08 20:03:23 (UTC)
commit10a0e05cc4962d9412a7a5faf3d69a3caf6d1c34 (patch) (unidiff)
tree3105b985a9dbedd31dff52e14fe667eeff4f9ff4 /kabc/phonenumber.cpp
parent13bd085e06b76228321f5a004759fcdf19cca711 (diff)
downloadkdepimpi-10a0e05cc4962d9412a7a5faf3d69a3caf6d1c34.zip
kdepimpi-10a0e05cc4962d9412a7a5faf3d69a3caf6d1c34.tar.gz
kdepimpi-10a0e05cc4962d9412a7a5faf3d69a3caf6d1c34.tar.bz2
added contact phone support
Diffstat (limited to 'kabc/phonenumber.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/phonenumber.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/kabc/phonenumber.cpp b/kabc/phonenumber.cpp
index 7aeb2ee..e5abc0e 100644
--- a/kabc/phonenumber.cpp
+++ b/kabc/phonenumber.cpp
@@ -66,6 +66,29 @@ bool PhoneNumber::operator!=( const PhoneNumber &p ) const
66 return !( p == *this ); 66 return !( p == *this );
67} 67}
68 68
69bool PhoneNumber::simplifyNumber()
70{
71 QString Number;
72 int i;
73 Number = mNumber.stripWhiteSpace ();
74 mNumber = "";
75 if ( Number.at(0) == '+' )
76 mNumber += "+";
77 for ( i = 0; i < Number.length(); ++i) {
78 if ( Number.at(i).isDigit() )
79 mNumber += Number.at(i);
80 }
81 return ( mNumber.length() > 0 );
82}
83// make cellphone compatible
84void PhoneNumber::simplifyType()
85{
86 if ( mType & Fax ) mType = Fax;
87 else if ( mType & Cell ) mType = Cell;
88 else if ( mType & Work ) mType = Work ;
89 else if ( mType & Home ) mType = Home;
90 else mType = Pref;
91}
69void PhoneNumber::setId( const QString &id ) 92void PhoneNumber::setId( const QString &id )
70{ 93{
71 mId = id; 94 mId = id;