summaryrefslogtreecommitdiffabout
path: root/kabc/address.cpp
Side-by-side diff
Diffstat (limited to 'kabc/address.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/address.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/kabc/address.cpp b/kabc/address.cpp
index 5ffe511..6151f9e 100644
--- a/kabc/address.cpp
+++ b/kabc/address.cpp
@@ -101,6 +101,33 @@ QStringList Address::asList()
if ( ! mLabel.isEmpty() )result.append(mLabel);
return result;
}
+
+bool Address::matchAddress( QRegExp* re ) const
+{
+
+#if QT_VERSION >= 0x030000
+ if (re->search( mPostOfficeBox ) == 0) return true;
+ if (re->search( mExtended ) == 0) return true;
+ if (re->search( mStreet ) == 0) return true;
+ if (re->search( mLocality ) == 0) return true;
+ if (re->search( mRegion ) == 0) return true;
+ if (re->search( mPostalCode ) == 0) return true;
+ if (re->search( mCountry ) == 0) return true;
+ if (re->search( mLabel ) == 0) return true;
+#else
+ if (re->match( mPostOfficeBox ) == 0) return true;
+ if (re->match( mExtended ) == 0) return true;
+ if (re->match( mStreet ) == 0) return true;
+ if (re->match( mLocality ) == 0) return true;
+ if (re->match( mRegion ) == 0) return true;
+ if (re->match( mPostalCode ) == 0) return true;
+ if (re->match( mCountry ) == 0) return true;
+ if (re->match( mLabel ) == 0) return true;
+#endif
+
+ return false;
+}
+
void Address::clear()
{
*this = Address();