Diffstat (limited to 'core/pim/osearch/contactitem.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/osearch/contactitem.cpp | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/core/pim/osearch/contactitem.cpp b/core/pim/osearch/contactitem.cpp index c89c6e2..81b6359 100644 --- a/core/pim/osearch/contactitem.cpp +++ b/core/pim/osearch/contactitem.cpp | |||
@@ -1,129 +1,130 @@ | |||
1 | // | 1 | // |
2 | // | 2 | // |
3 | // C++ Implementation: $MODULE$ | 3 | // C++ Implementation: $MODULE$ |
4 | // | 4 | // |
5 | // Description: | 5 | // Description: |
6 | // | 6 | // |
7 | // | 7 | // |
8 | // Author: Patrick S. Vogt <tille@handhelds.org>, (C) 2003 | 8 | // Author: Patrick S. Vogt <tille@handhelds.org>, (C) 2003 |
9 | // | 9 | // |
10 | // Copyright: See COPYING file that comes with this distribution | 10 | // Copyright: See COPYING file that comes with this distribution |
11 | // | 11 | // |
12 | // | 12 | // |
13 | #include "contactitem.h" | 13 | #include "contactitem.h" |
14 | 14 | ||
15 | #include <qpe/resource.h> | 15 | #include <opie2/oresource.h> |
16 | |||
16 | #include <qpe/qcopenvelope_qws.h> | 17 | #include <qpe/qcopenvelope_qws.h> |
17 | 18 | ||
18 | 19 | ||
19 | using namespace Opie; | 20 | using namespace Opie; |
20 | ContactItem::ContactItem(OListViewItem* parent, OPimContact *contact) | 21 | ContactItem::ContactItem(OListViewItem* parent, OPimContact *contact) |
21 | : ResultItem(parent) | 22 | : ResultItem(parent) |
22 | { | 23 | { |
23 | _contact = contact; | 24 | _contact = contact; |
24 | setText(0, _contact->toShortText()); | 25 | setText(0, _contact->toShortText()); |
25 | setIcon(); | 26 | setIcon(); |
26 | } | 27 | } |
27 | 28 | ||
28 | void ContactItem::setIcon() | 29 | void ContactItem::setIcon() |
29 | { | 30 | { |
30 | QPixmap icon; | 31 | QPixmap icon; |
31 | switch ( _contact->lastHitField() ) { | 32 | switch ( _contact->lastHitField() ) { |
32 | case -1: | 33 | case -1: |
33 | icon = Resource::loadPixmap( "reset" ); | 34 | icon = Opie::Core::OResource::loadPixmap( "reset", Opie::Core::OResource::SmallIcon ); |
34 | break; | 35 | break; |
35 | case Qtopia::BusinessPhone: | 36 | case Qtopia::BusinessPhone: |
36 | icon = Resource::loadPixmap( "addressbook/phonework" ); | 37 | icon = Opie::Core::OResource::loadPixmap( "addressbook/phonework", Opie::Core::OResource::SmallIcon ); |
37 | break; | 38 | break; |
38 | case Qtopia::BusinessFax: | 39 | case Qtopia::BusinessFax: |
39 | icon = Resource::loadPixmap( "addressbook/faxwork" ); | 40 | icon = Opie::Core::OResource::loadPixmap( "addressbook/faxwork", Opie::Core::OResource::SmallIcon ); |
40 | break; | 41 | break; |
41 | case Qtopia::BusinessMobile: | 42 | case Qtopia::BusinessMobile: |
42 | icon = Resource::loadPixmap( "addressbook/mobilework" ); | 43 | icon = Opie::Core::OResource::loadPixmap( "addressbook/mobilework", Opie::Core::OResource::SmallIcon ); |
43 | break; | 44 | break; |
44 | case Qtopia::DefaultEmail: | 45 | case Qtopia::DefaultEmail: |
45 | case Qtopia::Emails: | 46 | case Qtopia::Emails: |
46 | icon = Resource::loadPixmap( "addressbook/email" ); | 47 | icon = Opie::Core::OResource::loadPixmap( "addressbook/email", Opie::Core::OResource::SmallIcon ); |
47 | break; | 48 | break; |
48 | case Qtopia::HomePhone: | 49 | case Qtopia::HomePhone: |
49 | icon = Resource::loadPixmap( "addressbook/phonehome" ); | 50 | icon = Opie::Core::OResource::loadPixmap( "addressbook/phonehome", Opie::Core::OResource::SmallIcon ); |
50 | break; | 51 | break; |
51 | case Qtopia::HomeFax: | 52 | case Qtopia::HomeFax: |
52 | icon = Resource::loadPixmap( "addressbook/faxhome" ); | 53 | icon = Opie::Core::OResource::loadPixmap( "addressbook/faxhome", Opie::Core::OResource::SmallIcon ); |
53 | break; | 54 | break; |
54 | case Qtopia::HomeMobile: | 55 | case Qtopia::HomeMobile: |
55 | icon = Resource::loadPixmap( "addressbook/mobilehome" ); | 56 | icon = Opie::Core::OResource::loadPixmap( "addressbook/mobilehome", Opie::Core::OResource::SmallIcon ); |
56 | break; | 57 | break; |
57 | case Qtopia::HomeWebPage: | 58 | case Qtopia::HomeWebPage: |
58 | icon = Resource::loadPixmap( "addressbook/webpagehome" ); | 59 | icon = Opie::Core::OResource::loadPixmap( "addressbook/webpagehome", Opie::Core::OResource::SmallIcon ); |
59 | break; | 60 | break; |
60 | case Qtopia::BusinessWebPage: | 61 | case Qtopia::BusinessWebPage: |
61 | icon = Resource::loadPixmap( "addressbook/webpagework" ); | 62 | icon = Opie::Core::OResource::loadPixmap( "addressbook/webpagework", Opie::Core::OResource::SmallIcon ); |
62 | break; | 63 | break; |
63 | case Qtopia::Title: | 64 | case Qtopia::Title: |
64 | case Qtopia::JobTitle: | 65 | case Qtopia::JobTitle: |
65 | case Qtopia::FirstName: | 66 | case Qtopia::FirstName: |
66 | case Qtopia::MiddleName: | 67 | case Qtopia::MiddleName: |
67 | case Qtopia::LastName: | 68 | case Qtopia::LastName: |
68 | case Qtopia::Suffix: | 69 | case Qtopia::Suffix: |
69 | case Qtopia::Nickname: | 70 | case Qtopia::Nickname: |
70 | case Qtopia::FileAs: | 71 | case Qtopia::FileAs: |
71 | icon = Resource::loadPixmap( "addressbook/identity" ); | 72 | icon = Opie::Core::OResource::loadPixmap( "addressbook/identity", Opie::Core::OResource::SmallIcon ); |
72 | break; | 73 | break; |
73 | case Qtopia::HomeStreet: | 74 | case Qtopia::HomeStreet: |
74 | case Qtopia::HomeCity: | 75 | case Qtopia::HomeCity: |
75 | case Qtopia::HomeState: | 76 | case Qtopia::HomeState: |
76 | case Qtopia::HomeZip: | 77 | case Qtopia::HomeZip: |
77 | case Qtopia::HomeCountry: | 78 | case Qtopia::HomeCountry: |
78 | icon = Resource::loadPixmap( "osearch/addresshome" ); | 79 | icon = Opie::Core::OResource::loadPixmap( "osearch/addresshome", Opie::Core::OResource::SmallIcon ); |
79 | break; | 80 | break; |
80 | case Qtopia::Company: | 81 | case Qtopia::Company: |
81 | case Qtopia::BusinessCity: | 82 | case Qtopia::BusinessCity: |
82 | case Qtopia::BusinessStreet: | 83 | case Qtopia::BusinessStreet: |
83 | case Qtopia::BusinessZip: | 84 | case Qtopia::BusinessZip: |
84 | case Qtopia::BusinessCountry: | 85 | case Qtopia::BusinessCountry: |
85 | case Qtopia::Department: | 86 | case Qtopia::Department: |
86 | case Qtopia::Office: | 87 | case Qtopia::Office: |
87 | case Qtopia::Manager: | 88 | case Qtopia::Manager: |
88 | case Qtopia::BusinessPager: | 89 | case Qtopia::BusinessPager: |
89 | case Qtopia::Profession: | 90 | case Qtopia::Profession: |
90 | icon = Resource::loadPixmap( "osearch/addresshome" ); | 91 | icon = Opie::Core::OResource::loadPixmap( "osearch/addresshome", Opie::Core::OResource::SmallIcon ); |
91 | break; | 92 | break; |
92 | case Qtopia::Assistant: | 93 | case Qtopia::Assistant: |
93 | case Qtopia::Spouse: | 94 | case Qtopia::Spouse: |
94 | case Qtopia::Children: | 95 | case Qtopia::Children: |
95 | icon = Resource::loadPixmap( "osearch/personal" ); | 96 | icon = Opie::Core::OResource::loadPixmap( "osearch/personal", Opie::Core::OResource::SmallIcon ); |
96 | break; | 97 | break; |
97 | case Qtopia::Birthday: | 98 | case Qtopia::Birthday: |
98 | case Qtopia::Anniversary: | 99 | case Qtopia::Anniversary: |
99 | icon = Resource::loadPixmap( "osearch/clock" ); | 100 | icon = Opie::Core::OResource::loadPixmap( "osearch/clock", Opie::Core::OResource::SmallIcon ); |
100 | break; | 101 | break; |
101 | case Qtopia::Notes: | 102 | case Qtopia::Notes: |
102 | icon = Resource::loadPixmap( "txt" ); | 103 | icon = Opie::Core::OResource::loadPixmap( "txt", Opie::Core::OResource::SmallIcon ); |
103 | break; | 104 | break; |
104 | default: | 105 | default: |
105 | icon = Resource::loadPixmap( "DocsIcon" ); | 106 | icon = Opie::Core::OResource::loadPixmap( "DocsIcon", Opie::Core::OResource::SmallIcon ); |
106 | break; | 107 | break; |
107 | } | 108 | } |
108 | setPixmap( 0, icon ); | 109 | setPixmap( 0, icon ); |
109 | } | 110 | } |
110 | 111 | ||
111 | ContactItem::~ContactItem() | 112 | ContactItem::~ContactItem() |
112 | { | 113 | { |
113 | delete _contact; | 114 | delete _contact; |
114 | } | 115 | } |
115 | 116 | ||
116 | 117 | ||
117 | QString ContactItem::toRichText() | 118 | QString ContactItem::toRichText() |
118 | { | 119 | { |
119 | return _contact->toRichText(); | 120 | return _contact->toRichText(); |
120 | } | 121 | } |
121 | 122 | ||
122 | void ContactItem::action( int act ) | 123 | void ContactItem::action( int act ) |
123 | { | 124 | { |
124 | if (act == 0){ | 125 | if (act == 0){ |
125 | QCopEnvelope e("QPE/Application/addressbook", "show(int)"); | 126 | QCopEnvelope e("QPE/Application/addressbook", "show(int)"); |
126 | e << _contact->uid(); | 127 | e << _contact->uid(); |
127 | }else if(act == 1){ | 128 | }else if(act == 1){ |
128 | QCopEnvelope e("QPE/Application/addressbook", "edit(int)"); | 129 | QCopEnvelope e("QPE/Application/addressbook", "edit(int)"); |
129 | e << _contact->uid(); | 130 | e << _contact->uid(); |