-rw-r--r-- | kabc/addresseedialog.cpp | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/kabc/addresseedialog.cpp b/kabc/addresseedialog.cpp index 19b52bb..e89584d 100644 --- a/kabc/addresseedialog.cpp +++ b/kabc/addresseedialog.cpp | |||
@@ -37,20 +37,17 @@ | |||
37 | //#include "addresseedialog.moc" | 37 | //#include "addresseedialog.moc" |
38 | 38 | ||
39 | using namespace KABC; | 39 | using namespace KABC; |
40 | 40 | ||
41 | AddresseeItem::AddresseeItem( QListView *parent, const Addressee &addressee ) : | 41 | AddresseeItem::AddresseeItem( QListView *parent, const Addressee &addressee ) : |
42 | QListViewItem( parent ), | 42 | QListViewItem( parent ), |
43 | mAddressee( addressee ) | 43 | mAddressee( addressee ) |
44 | { | 44 | { |
45 | QString name = addressee.familyName()+", "+ addressee.givenName(); | 45 | setText( Name,addressee.realName()); |
46 | if ( name.length() == 2 ) | ||
47 | name = addressee.organization(); | ||
48 | setText( Name,name); | ||
49 | setText( Email, addressee.preferredEmail() ); | 46 | setText( Email, addressee.preferredEmail() ); |
50 | } | 47 | } |
51 | 48 | ||
52 | QString AddresseeItem::key( int column, bool ) const | 49 | QString AddresseeItem::key( int column, bool ) const |
53 | { | 50 | { |
54 | 51 | ||
55 | if (column == Email) { | 52 | if (column == Email) { |
56 | QString value = text(Email); | 53 | QString value = text(Email); |
@@ -160,19 +157,17 @@ void AddresseeDialog::loadAddressBook() | |||
160 | re.setWildcard(true); // most people understand these better. | 157 | re.setWildcard(true); // most people understand these better. |
161 | re.setCaseSensitive(false); | 158 | re.setCaseSensitive(false); |
162 | re.setPattern( "*"+ mAddresseeEdit->text() + "*"); | 159 | re.setPattern( "*"+ mAddresseeEdit->text() + "*"); |
163 | 160 | ||
164 | AddressBook::Iterator it; | 161 | AddressBook::Iterator it; |
165 | for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { | 162 | for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { |
166 | if ( (*it).uid().left(2) == "la" && (*it).uid().left(19) == QString("last-syncAddressee-") ) | 163 | if ( (*it).uid().left(2) == "la" && (*it).uid().left(19) == QString("last-syncAddressee-") ) |
167 | continue; | 164 | continue; |
168 | QString name = (*it).familyName()+", "+ (*it).givenName(); | 165 | QString name = (*it).realName(); |
169 | if ( name.length() == 2 ) | ||
170 | name = (*it).realName(); | ||
171 | name += (*it).preferredEmail(); | 166 | name += (*it).preferredEmail(); |
172 | #if QT_VERSION >= 0x030000 | 167 | #if QT_VERSION >= 0x030000 |
173 | if (re.search(name) != -1) | 168 | if (re.search(name) != -1) |
174 | #else | 169 | #else |
175 | if (re.match(name) != -1) | 170 | if (re.match(name) != -1) |
176 | #endif | 171 | #endif |
177 | AddresseeItem *item = new AddresseeItem( mAddresseeList, (*it) ); | 172 | AddresseeItem *item = new AddresseeItem( mAddresseeList, (*it) ); |
178 | } | 173 | } |