summaryrefslogtreecommitdiffabout
path: root/kabc/addressee.cpp
authorzautrix <zautrix>2004-09-21 07:05:01 (UTC)
committer zautrix <zautrix>2004-09-21 07:05:01 (UTC)
commit434ddaa08e0a650422ef271332a1d11879028095 (patch) (side-by-side diff)
treee4f229120d8bfa9febb7ab123b1311329f0e6aa4 /kabc/addressee.cpp
parented49c55dac215ac2ed9286ebfc36e5a19417f0bb (diff)
downloadkdepimpi-434ddaa08e0a650422ef271332a1d11879028095.zip
kdepimpi-434ddaa08e0a650422ef271332a1d11879028095.tar.gz
kdepimpi-434ddaa08e0a650422ef271332a1d11879028095.tar.bz2
DTM sync fixes
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;
static bool matchBinaryPattern( int value, int pattern );
+static bool matchBinaryPatternA( int value, int pattern );
+static bool matchBinaryPatternP( int value, int pattern );
@@ -383,3 +385,3 @@ void Addressee::setOriginalExternalUID( const QString &id )
mData->empty = false;
- qDebug("*******Set orig uid %s ", id.latin1());
+ //qDebug("*******Set orig uid %s ", id.latin1());
mData->originalExternalUID = id;
@@ -396,3 +398,3 @@ void Addressee::setUid( const QString &id )
detach();
- qDebug("****setuid %s ", id.latin1());
+ //qDebug("****setuid %s ", id.latin1());
mData->empty = false;
@@ -1292,3 +1294,3 @@ PhoneNumber Addressee::phoneNumber( int type ) const
for( it = mData->phoneNumbers.begin(); it != mData->phoneNumbers.end(); ++it ) {
- if ( matchBinaryPattern( (*it).type(), type ) ) {
+ if ( matchBinaryPatternP( (*it).type(), type ) ) {
if ( (*it).type() & PhoneNumber::Pref )
@@ -1529,3 +1531,3 @@ Address Addressee::address( int type ) const
for( it = mData->addresses.begin(); it != mData->addresses.end(); ++it ) {
- if ( matchBinaryPattern( (*it).type(), type ) ) {
+ if ( matchBinaryPatternA( (*it).type(), type ) ) {
if ( (*it).type() & Address::Pref )
@@ -1837,3 +1839,2 @@ QDataStream &KABC::operator>>( QDataStream &s, Addressee &a )
}
-
bool matchBinaryPattern( int value, int pattern )
@@ -1851 +1852,18 @@ bool matchBinaryPattern( int value, int pattern )
}
+
+bool matchBinaryPatternP( int value, int pattern )
+{
+
+ if ( pattern == 0 )
+ return ( value == 0 );
+ else
+ return ( (pattern |PhoneNumber::Pref ) == ( value |PhoneNumber::Pref ) );
+}
+bool matchBinaryPatternA( int value, int pattern )
+{
+
+ if ( pattern == 0 )
+ return ( value == 0 );
+ else
+ return ( (pattern | Address::Pref) == ( value | Address::Pref ) );
+}