summaryrefslogtreecommitdiffabout
path: root/kabc/address.cpp
Unidiff
Diffstat (limited to 'kabc/address.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/address.cpp13
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
75 75
76bool Address::isEmpty() const 76bool Address::isEmpty() const
77{ 77{
78 if ( mPostOfficeBox.isEmpty() && 78 if ( mPostOfficeBox.isEmpty() &&
79 mExtended.isEmpty() && 79 mExtended.isEmpty() &&
80 mStreet.isEmpty() && 80 mStreet.isEmpty() &&
81 mLocality.isEmpty() && 81 mLocality.isEmpty() &&
82 mRegion.isEmpty() && 82 mRegion.isEmpty() &&
83 mPostalCode.isEmpty() && 83 mPostalCode.isEmpty() &&
84 mCountry.isEmpty() && 84 mCountry.isEmpty() &&
85 mLabel.isEmpty() ) { 85 mLabel.isEmpty() ) {
86 return true; 86 return true;
87 } 87 }
88 return false; 88 return false;
89} 89}
90 90
91QStringList Address::asList()
92{
93 QStringList result;
94 if ( ! mPostOfficeBox.isEmpty() )result.append(mPostOfficeBox);
95 if ( ! mExtended.isEmpty())result.append(mExtended);
96 if ( ! mStreet.isEmpty())result.append(mStreet);
97 if ( ! mLocality.isEmpty() )result.append(mLocality);
98 if ( ! mRegion.isEmpty())result.append(mRegion);
99 if ( ! mPostalCode.isEmpty())result.append(mPostalCode);
100 if ( ! mCountry.isEmpty())result.append(mCountry);
101 if ( ! mLabel.isEmpty() )result.append(mLabel);
102 return result;
103}
91void Address::clear() 104void Address::clear()
92{ 105{
93 *this = Address(); 106 *this = Address();
94} 107}
95 108
96void Address::setId( const QString &id ) 109void Address::setId( const QString &id )
97{ 110{
98 mEmpty = false; 111 mEmpty = false;
99 112
100 mId = id; 113 mId = id;
101} 114}
102 115
103QString Address::id() const 116QString Address::id() const
104{ 117{
105 return mId; 118 return mId;
106} 119}