-rw-r--r-- | kaddressbook/views/kaddressbookcardview.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kaddressbook/views/kaddressbookcardview.cpp b/kaddressbook/views/kaddressbookcardview.cpp index 2b40909..cce68b9 100644 --- a/kaddressbook/views/kaddressbookcardview.cpp +++ b/kaddressbook/views/kaddressbookcardview.cpp | |||
@@ -30,65 +30,65 @@ | |||
30 | #include <qapplication.h> | 30 | #include <qapplication.h> |
31 | 31 | ||
32 | #include <kabc/addressbook.h> | 32 | #include <kabc/addressbook.h> |
33 | #include <kabc/addressee.h> | 33 | #include <kabc/addressee.h> |
34 | #include <kconfig.h> | 34 | #include <kconfig.h> |
35 | #include <kdebug.h> | 35 | #include <kdebug.h> |
36 | #include <klocale.h> | 36 | #include <klocale.h> |
37 | 37 | ||
38 | #include "kabprefs.h" | 38 | #include "kabprefs.h" |
39 | #include "viewmanager.h" | 39 | #include "viewmanager.h" |
40 | 40 | ||
41 | 41 | ||
42 | #include "kaddressbookcardview.h" | 42 | #include "kaddressbookcardview.h" |
43 | 43 | ||
44 | #ifndef KAB_EMBEDDED | 44 | #ifndef KAB_EMBEDDED |
45 | extern "C" { | 45 | extern "C" { |
46 | void *init_libkaddrbk_cardview() | 46 | void *init_libkaddrbk_cardview() |
47 | { | 47 | { |
48 | return ( new CardViewFactory ); | 48 | return ( new CardViewFactory ); |
49 | } | 49 | } |
50 | } | 50 | } |
51 | #endif //KAB_EMBEDDED | 51 | #endif //KAB_EMBEDDED |
52 | 52 | ||
53 | //////////////////////////////// | 53 | //////////////////////////////// |
54 | // AddresseeCardViewItem (internal class) | 54 | // AddresseeCardViewItem (internal class) |
55 | class AddresseeCardViewItem : public CardViewItem | 55 | class AddresseeCardViewItem : public CardViewItem |
56 | { | 56 | { |
57 | public: | 57 | public: |
58 | AddresseeCardViewItem(const KABC::Field::List &fields, | 58 | AddresseeCardViewItem(const KABC::Field::List &fields, |
59 | bool showEmptyFields, | 59 | bool showEmptyFields, |
60 | KABC::AddressBook *doc, const KABC::Addressee &a, | 60 | KABC::AddressBook *doc, const KABC::Addressee &a, |
61 | CardView *parent) | 61 | CardView *parent) |
62 | : CardViewItem(parent, a.formattedName()), | 62 | : CardViewItem(parent, a.realName() ), |
63 | mFields( fields ), mShowEmptyFields(showEmptyFields), | 63 | mFields( fields ), mShowEmptyFields(showEmptyFields), |
64 | mDocument(doc), mAddressee(a) | 64 | mDocument(doc), mAddressee(a) |
65 | { | 65 | { |
66 | if ( mFields.isEmpty() ) { | 66 | if ( mFields.isEmpty() ) { |
67 | mFields = KABC::Field::defaultFields(); | 67 | mFields = KABC::Field::defaultFields(); |
68 | } | 68 | } |
69 | refresh(); | 69 | refresh(); |
70 | } | 70 | } |
71 | 71 | ||
72 | const KABC::Addressee &addressee() const { return mAddressee; } | 72 | const KABC::Addressee &addressee() const { return mAddressee; } |
73 | 73 | ||
74 | void refresh() | 74 | void refresh() |
75 | { | 75 | { |
76 | // Update our addressee, since it may have changed elsewhere | 76 | // Update our addressee, since it may have changed elsewhere |
77 | mAddressee = mDocument->findByUid(mAddressee.uid()); | 77 | mAddressee = mDocument->findByUid(mAddressee.uid()); |
78 | 78 | ||
79 | if (!mAddressee.isEmpty()) | 79 | if (!mAddressee.isEmpty()) |
80 | { | 80 | { |
81 | clearFields(); | 81 | clearFields(); |
82 | 82 | ||
83 | // Try all the selected fields until we find one with text. | 83 | // Try all the selected fields until we find one with text. |
84 | // This will limit the number of unlabeled icons in the view | 84 | // This will limit the number of unlabeled icons in the view |
85 | KABC::Field::List::Iterator iter; | 85 | KABC::Field::List::Iterator iter; |
86 | for (iter = mFields.begin(); iter != mFields.end(); ++iter) | 86 | for (iter = mFields.begin(); iter != mFields.end(); ++iter) |
87 | { | 87 | { |
88 | // insert empty fields or not? not doing so saves a bit of memory and CPU | 88 | // insert empty fields or not? not doing so saves a bit of memory and CPU |
89 | // (during geometry calculations), but prevents having equally | 89 | // (during geometry calculations), but prevents having equally |
90 | // wide label columns in all cards, unless CardViewItem/CardView search | 90 | // wide label columns in all cards, unless CardViewItem/CardView search |
91 | // globally for the widest label. (anders) | 91 | // globally for the widest label. (anders) |
92 | //if (mShowEmptyFields || !(*iter)->value( mAddressee ).isEmpty()) | 92 | //if (mShowEmptyFields || !(*iter)->value( mAddressee ).isEmpty()) |
93 | insertField((*iter)->label(), (*iter)->value( mAddressee )); | 93 | insertField((*iter)->label(), (*iter)->value( mAddressee )); |
94 | } | 94 | } |