-rw-r--r-- | kabc/address.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/kabc/address.cpp b/kabc/address.cpp index c820a6c..5ffe511 100644 --- a/kabc/address.cpp +++ b/kabc/address.cpp @@ -75,32 +75,45 @@ bool Address::operator!=( const Address &a ) const bool Address::isEmpty() const { if ( mPostOfficeBox.isEmpty() && mExtended.isEmpty() && mStreet.isEmpty() && mLocality.isEmpty() && mRegion.isEmpty() && mPostalCode.isEmpty() && mCountry.isEmpty() && mLabel.isEmpty() ) { return true; } return false; } +QStringList Address::asList() +{ + QStringList result; + if ( ! mPostOfficeBox.isEmpty() )result.append(mPostOfficeBox); + if ( ! mExtended.isEmpty())result.append(mExtended); + if ( ! mStreet.isEmpty())result.append(mStreet); + if ( ! mLocality.isEmpty() )result.append(mLocality); + if ( ! mRegion.isEmpty())result.append(mRegion); + if ( ! mPostalCode.isEmpty())result.append(mPostalCode); + if ( ! mCountry.isEmpty())result.append(mCountry); + if ( ! mLabel.isEmpty() )result.append(mLabel); + return result; +} void Address::clear() { *this = Address(); } void Address::setId( const QString &id ) { mEmpty = false; mId = id; } QString Address::id() const { return mId; } |