summaryrefslogtreecommitdiffabout
path: root/kabc/addressee.cpp
Unidiff
Diffstat (limited to 'kabc/addressee.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/addressee.cpp28
1 files changed, 23 insertions, 5 deletions
diff --git a/kabc/addressee.cpp b/kabc/addressee.cpp
index e241281..31ce1d6 100644
--- a/kabc/addressee.cpp
+++ b/kabc/addressee.cpp
@@ -45,2 +45,4 @@ using namespace KABC;
45static bool matchBinaryPattern( int value, int pattern ); 45static bool matchBinaryPattern( int value, int pattern );
46static bool matchBinaryPatternA( int value, int pattern );
47static bool matchBinaryPatternP( int value, int pattern );
46 48
@@ -383,3 +385,3 @@ void Addressee::setOriginalExternalUID( const QString &id )
383 mData->empty = false; 385 mData->empty = false;
384 qDebug("*******Set orig uid %s ", id.latin1()); 386 //qDebug("*******Set orig uid %s ", id.latin1());
385 mData->originalExternalUID = id; 387 mData->originalExternalUID = id;
@@ -396,3 +398,3 @@ void Addressee::setUid( const QString &id )
396 detach(); 398 detach();
397 qDebug("****setuid %s ", id.latin1()); 399 //qDebug("****setuid %s ", id.latin1());
398 mData->empty = false; 400 mData->empty = false;
@@ -1292,3 +1294,3 @@ PhoneNumber Addressee::phoneNumber( int type ) const
1292 for( it = mData->phoneNumbers.begin(); it != mData->phoneNumbers.end(); ++it ) { 1294 for( it = mData->phoneNumbers.begin(); it != mData->phoneNumbers.end(); ++it ) {
1293 if ( matchBinaryPattern( (*it).type(), type ) ) { 1295 if ( matchBinaryPatternP( (*it).type(), type ) ) {
1294 if ( (*it).type() & PhoneNumber::Pref ) 1296 if ( (*it).type() & PhoneNumber::Pref )
@@ -1529,3 +1531,3 @@ Address Addressee::address( int type ) const
1529 for( it = mData->addresses.begin(); it != mData->addresses.end(); ++it ) { 1531 for( it = mData->addresses.begin(); it != mData->addresses.end(); ++it ) {
1530 if ( matchBinaryPattern( (*it).type(), type ) ) { 1532 if ( matchBinaryPatternA( (*it).type(), type ) ) {
1531 if ( (*it).type() & Address::Pref ) 1533 if ( (*it).type() & Address::Pref )
@@ -1837,3 +1839,2 @@ QDataStream &KABC::operator>>( QDataStream &s, Addressee &a )
1837} 1839}
1838
1839bool matchBinaryPattern( int value, int pattern ) 1840bool matchBinaryPattern( int value, int pattern )
@@ -1851 +1852,18 @@ bool matchBinaryPattern( int value, int pattern )
1851} 1852}
1853
1854bool matchBinaryPatternP( int value, int pattern )
1855{
1856
1857 if ( pattern == 0 )
1858 return ( value == 0 );
1859 else
1860 return ( (pattern |PhoneNumber::Pref ) == ( value |PhoneNumber::Pref ) );
1861}
1862bool matchBinaryPatternA( int value, int pattern )
1863{
1864
1865 if ( pattern == 0 )
1866 return ( value == 0 );
1867 else
1868 return ( (pattern | Address::Pref) == ( value | Address::Pref ) );
1869}