31 #include "NcnOutboxSender.h" |
31 #include "NcnOutboxSender.h" |
32 #include "NcnOutboxObserver.h" |
32 #include "NcnOutboxObserver.h" |
33 #include "NcnModelBase.h" |
33 #include "NcnModelBase.h" |
34 #include "CNcnMsvSessionHandler.h" |
34 #include "CNcnMsvSessionHandler.h" |
35 #include "CNcnMobileSignalStrengthHandler.h" |
35 #include "CNcnMobileSignalStrengthHandler.h" |
36 |
36 #include <MIUTSET.H> |
|
37 |
|
38 const TUid KUidMsgTypeCmailMtmVal = {0x2001F406}; |
37 // ================= MEMBER FUNCTIONS ======================= |
39 // ================= MEMBER FUNCTIONS ======================= |
38 |
40 |
39 // --------------------------------------------------------- |
41 // --------------------------------------------------------- |
40 // CNcnOutboxObserver::CNcnOutboxObserver |
42 // CNcnOutboxObserver::CNcnOutboxObserver |
41 // --------------------------------------------------------- |
43 // --------------------------------------------------------- |
115 { |
117 { |
116 NCN_RDEBUG( _L("CNcnOutboxObserver::CheckOutboxAndNotifyL" ) ); |
118 NCN_RDEBUG( _L("CNcnOutboxObserver::CheckOutboxAndNotifyL" ) ); |
117 // Check messagecount in outbox |
119 // Check messagecount in outbox |
118 TInt msgCount = iOutboxFolder->Count(); |
120 TInt msgCount = iOutboxFolder->Count(); |
119 |
121 |
|
122 CMsvEntrySelection *smtpselection = NULL ; |
|
123 CMsvEntrySelection *pop3selection = NULL; |
|
124 CMsvEntrySelection *imapselection = NULL ; |
|
125 CMsvEntrySelection *cmailselection = NULL ; |
|
126 |
|
127 smtpselection = iOutboxFolder ->ChildrenWithMtmL( KUidMsgTypeSMTP ); |
|
128 CleanupStack::PushL( smtpselection ); |
|
129 TInt smtpCount= smtpselection ->Count(); |
|
130 |
|
131 pop3selection = iOutboxFolder ->ChildrenWithMtmL( KUidMsgTypePOP3 ); |
|
132 CleanupStack::PushL( pop3selection ); |
|
133 TInt pop3Count= pop3selection ->Count(); |
|
134 |
|
135 imapselection = iOutboxFolder ->ChildrenWithMtmL( KUidMsgTypeIMAP4 ); |
|
136 CleanupStack::PushL( imapselection ); |
|
137 TInt imapCount= imapselection ->Count(); |
|
138 |
|
139 cmailselection = iOutboxFolder ->ChildrenWithMtmL( KUidMsgTypeCmailMtmVal); |
|
140 CleanupStack::PushL( cmailselection ); |
|
141 TInt cmailCount= cmailselection ->Count(); |
|
142 |
|
143 CleanupStack::Pop( 4 ); |
|
144 // Check messagecount in outbox |
|
145 msgCount = msgCount - (smtpCount+pop3Count+ imapCount+cmailCount); |
120 // Set msg count to the CR key |
146 // Set msg count to the CR key |
121 NCN_RDEBUG_INT( _L("CNcnOutboxObserver::CheckOutboxAndNotifyL SetCRInt(KNcnMessageCountInOutbox) %d" ), msgCount ); |
147 NCN_RDEBUG_INT( _L("CNcnOutboxObserver::CheckOutboxAndNotifyL SetCRInt(KNcnMessageCountInOutbox) %d" ), msgCount ); |
122 User::LeaveIfError( iModel->SetCRInt( |
148 User::LeaveIfError( iModel->SetCRInt( |
123 KCRUidNcnList, KNcnMessageCountInOutbox, msgCount ) ); |
149 KCRUidNcnList, KNcnMessageCountInOutbox, msgCount ) ); |
124 |
150 |