Diffstat (limited to 'core/pim/osearch/contactitem.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | core/pim/osearch/contactitem.cpp | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/core/pim/osearch/contactitem.cpp b/core/pim/osearch/contactitem.cpp index 7d8ecf1..3928b1f 100644 --- a/core/pim/osearch/contactitem.cpp +++ b/core/pim/osearch/contactitem.cpp | |||
@@ -14,3 +14,5 @@ | |||
14 | 14 | ||
15 | #include <qpixmap.h> | ||
15 | #include <opie/ocontact.h> | 16 | #include <opie/ocontact.h> |
17 | #include <qpe/resource.h> | ||
16 | #include <qpe/qcopenvelope_qws.h> | 18 | #include <qpe/qcopenvelope_qws.h> |
@@ -22,4 +24,89 @@ ContactItem::ContactItem(OListViewItem* parent, OContact *contact) | |||
22 | setText(0, _contact->toShortText()); | 24 | setText(0, _contact->toShortText()); |
25 | setIcon(); | ||
23 | } | 26 | } |
24 | 27 | ||
28 | void ContactItem::setIcon() | ||
29 | { | ||
30 | QPixmap icon; | ||
31 | switch ( _contact->lastHitField() ) { | ||
32 | case -1: | ||
33 | icon = Resource::loadPixmap( "reset" ); | ||
34 | break; | ||
35 | case Qtopia::BusinessPhone: | ||
36 | icon = Resource::loadPixmap( "addressbook/phonework" ); | ||
37 | break; | ||
38 | case Qtopia::BusinessFax: | ||
39 | icon = Resource::loadPixmap( "addressbook/faxwork" ); | ||
40 | break; | ||
41 | case Qtopia::BusinessMobile: | ||
42 | icon = Resource::loadPixmap( "addressbook/mobilework" ); | ||
43 | break; | ||
44 | case Qtopia::DefaultEmail: | ||
45 | icon = Resource::loadPixmap( "addressbook/email" ); | ||
46 | break; | ||
47 | case Qtopia::Emails: | ||
48 | icon = Resource::loadPixmap( "addressbook/email" ); | ||
49 | break; | ||
50 | case Qtopia::HomePhone: | ||
51 | qDebug("homephone"); | ||
52 | icon = Resource::loadPixmap( "addressbook/phonehome" ); | ||
53 | break; | ||
54 | case Qtopia::HomeFax: | ||
55 | icon = Resource::loadPixmap( "addressbook/faxhome" ); | ||
56 | break; | ||
57 | case Qtopia::HomeMobile: | ||
58 | icon = Resource::loadPixmap( "addressbook/mobilehome" ); | ||
59 | break; | ||
60 | case Qtopia::HomeWebPage: | ||
61 | icon = Resource::loadPixmap( "addressbook/webpagehome" ); | ||
62 | break; | ||
63 | case Qtopia::BusinessWebPage: | ||
64 | icon = Resource::loadPixmap( "addressbook/webpagework" ); | ||
65 | break; | ||
66 | case Qtopia::Title: | ||
67 | case Qtopia::FirstName: | ||
68 | case Qtopia::MiddleName: | ||
69 | case Qtopia::LastName: | ||
70 | case Qtopia::Suffix: | ||
71 | case Qtopia::Nickname: | ||
72 | case Qtopia::FileAs: | ||
73 | icon = Resource::loadPixmap( "addressbook/identity" ); | ||
74 | break; | ||
75 | case Qtopia::HomeStreet: | ||
76 | case Qtopia::HomeCity: | ||
77 | case Qtopia::HomeState: | ||
78 | case Qtopia::HomeZip: | ||
79 | case Qtopia::HomeCountry: | ||
80 | icon = Resource::loadPixmap( "addressbook/addresshome" ); | ||
81 | break; | ||
82 | case Qtopia::Company: | ||
83 | case Qtopia::BusinessCity: | ||
84 | case Qtopia::BusinessStreet: | ||
85 | case Qtopia::BusinessZip: | ||
86 | case Qtopia::BusinessCountry: | ||
87 | case Qtopia::JobTitle: | ||
88 | case Qtopia::Department: | ||
89 | case Qtopia::Office: | ||
90 | case Qtopia::Manager: | ||
91 | case Qtopia::BusinessPager: | ||
92 | case Qtopia::Profession: | ||
93 | icon = Resource::loadPixmap( "addressbook/addresshome" ); | ||
94 | break; | ||
95 | case Qtopia::Assistant: | ||
96 | case Qtopia::Spouse: | ||
97 | case Qtopia::Children: | ||
98 | icon = Resource::loadPixmap( "osearch/personal" ); | ||
99 | break; | ||
100 | case Qtopia::Birthday: | ||
101 | case Qtopia::Anniversary: | ||
102 | icon = Resource::loadPixmap( "osearch/clock" ); | ||
103 | break; | ||
104 | case Qtopia::Notes: | ||
105 | break; | ||
106 | default: | ||
107 | icon = Resource::loadPixmap( "DocsIcon" ); | ||
108 | break; | ||
109 | } | ||
110 | setPixmap( 0, icon ); | ||
111 | } | ||
25 | 112 | ||