equal
deleted
inserted
replaced
146 m_contactsEmitted.removeOne(id); |
146 m_contactsEmitted.removeOne(id); |
147 else |
147 else |
148 changeSet.insertAddedContact(id); |
148 changeSet.insertAddedContact(id); |
149 break; |
149 break; |
150 case EContactDbObserverEventOwnCardDeleted: |
150 case EContactDbObserverEventOwnCardDeleted: |
|
151 if (m_contactsEmitted.contains(id)) { |
|
152 m_contactsEmitted.removeOne(id); |
|
153 } else { |
|
154 // signal selfContactIdChanged (from id to zero) |
|
155 QOwnCardPair ownCard(m_currentOwnCardId, QContactLocalId(0)); |
|
156 changeSet.setOldAndNewSelfContactId(ownCard); |
|
157 // signal contactsRemoved (the self contact was deleted) |
|
158 changeSet.insertRemovedContact(id); |
|
159 } |
|
160 // reset own card id |
151 m_currentOwnCardId = QContactLocalId(0); |
161 m_currentOwnCardId = QContactLocalId(0); |
152 // ...and send contact deleted event |
162 break; |
153 case EContactDbObserverEventContactDeleted: |
163 case EContactDbObserverEventContactDeleted: |
154 if(m_contactsEmitted.contains(id)) |
164 if(m_contactsEmitted.contains(id)) |
155 m_contactsEmitted.removeOne(id); |
165 m_contactsEmitted.removeOne(id); |
156 else |
166 else |
157 changeSet.insertRemovedContact(id); |
167 changeSet.insertRemovedContact(id); |
216 changeSet.insertChangedContact(id); //group is a contact |
226 changeSet.insertChangedContact(id); //group is a contact |
217 #endif |
227 #endif |
218 } |
228 } |
219 break; |
229 break; |
220 case EContactDbObserverEventOwnCardChanged: |
230 case EContactDbObserverEventOwnCardChanged: |
221 if(m_contactsEmitted.contains(id)) |
231 if (m_contactsEmitted.contains(id)) { |
222 m_contactsEmitted.removeOne(id); |
232 m_contactsEmitted.removeOne(id); |
223 else { |
233 } else { |
224 QOwnCardPair ownCard(m_currentOwnCardId, QContactLocalId(id)); |
234 QOwnCardPair ownCard(m_currentOwnCardId, QContactLocalId(id)); |
225 changeSet.setOldAndNewSelfContactId(ownCard); |
235 changeSet.setOldAndNewSelfContactId(ownCard); |
226 m_currentOwnCardId = QContactLocalId(id); |
236 m_currentOwnCardId = QContactLocalId(id); |
227 } |
237 } |
228 break; |
238 break; |