messagingapp/msgutils/unidatautils/unidatamodelplugins/unibiomessagedataplugin/src/unibiomessagedataplugin.cpp
equal
deleted
inserted
replaced
16 */ |
16 */ |
17 |
17 |
18 //SYSTEM INCLUDES |
18 //SYSTEM INCLUDES |
19 #include <mtclreg.h> |
19 #include <mtclreg.h> |
20 #include <mtclbase.h> |
20 #include <mtclbase.h> |
21 #include <s60qconversions.h> |
21 #include <xqconversions.h> |
22 |
22 |
23 //USER INCLUDES |
23 //USER INCLUDES |
24 #include "unibiomessagedataplugin.h" |
24 #include "unibiomessagedataplugin.h" |
25 #include "unibiomessagedataplugin_p.h" |
25 #include "unibiomessagedataplugin_p.h" |
26 |
26 |
120 //--------------------------------------------------------------- |
120 //--------------------------------------------------------------- |
121 UniMessageInfoList UniBioMessageDataPlugin::attachmentList() |
121 UniMessageInfoList UniBioMessageDataPlugin::attachmentList() |
122 { |
122 { |
123 RFile file = d_ptr->attachmentL(); |
123 RFile file = d_ptr->attachmentL(); |
124 |
124 |
|
125 if(attachmentCount() == 0) |
|
126 { |
|
127 file.Close(); |
|
128 return QList<UniMessageInfo*> (); |
|
129 } |
|
130 |
125 UniMessageInfoList attlist; |
131 UniMessageInfoList attlist; |
126 |
132 |
127 QString path; |
133 QString path; |
128 QString mimetype; |
134 QString mimetype; |
129 int size; |
135 int size; |
130 |
136 |
131 TFileName fullName; |
137 TFileName fullName; |
132 User::LeaveIfError(file.FullName(fullName)); |
138 User::LeaveIfError(file.FullName(fullName)); |
133 User::LeaveIfError(file.Size(size)); |
139 User::LeaveIfError(file.Size(size)); |
134 |
140 |
135 path = S60QConversions::s60DescToQString(*fullName.AllocL()); |
141 path = XQConversions::s60DescToQString(*fullName.AllocL()); |
136 |
142 |
137 UniMessageInfo *msgobj = new UniMessageInfo(path, size, mimetype); |
143 UniMessageInfo *msgobj = new UniMessageInfo(path, size, mimetype); |
138 attlist << msgobj; |
144 attlist << msgobj; |
139 file.Close(); |
145 file.Close(); |
140 return attlist; |
146 return attlist; |
168 // UniBioMessageDataPlugin::hasAttachment() |
174 // UniBioMessageDataPlugin::hasAttachment() |
169 // @see header |
175 // @see header |
170 //--------------------------------------------------------------- |
176 //--------------------------------------------------------------- |
171 bool UniBioMessageDataPlugin::hasAttachment() |
177 bool UniBioMessageDataPlugin::hasAttachment() |
172 { |
178 { |
173 return true; |
179 if(attachmentCount() > 0) |
|
180 return true; |
|
181 else |
|
182 return false; |
|
183 |
174 } |
184 } |
175 |
185 |
176 // UniBioMessageDataPlugin::objectCount() |
186 // UniBioMessageDataPlugin::objectCount() |
177 // @see header |
187 // @see header |
178 //--------------------------------------------------------------- |
188 //--------------------------------------------------------------- |