diff options
Diffstat (limited to 'plugins/Clist_nicer')
-rw-r--r-- | plugins/Clist_nicer/src/clistevents.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/plugins/Clist_nicer/src/clistevents.cpp b/plugins/Clist_nicer/src/clistevents.cpp index 288d55cdcc..d9856cec30 100644 --- a/plugins/Clist_nicer/src/clistevents.cpp +++ b/plugins/Clist_nicer/src/clistevents.cpp @@ -315,19 +315,19 @@ CListEvent* AddEvent(CLISTEVENT *cle) int RemoveEvent(MCONTACT hContact, MEVENT hDbEvent)
{
// Find the event that should be removed
- int i;
- for (i = 0; i < pcli->events->getCount(); i++) {
- CListEvent &e = (*pcli->events)[i];
- if (e.hContact == hContact && e.hDbEvent == hDbEvent)
+ CListEvent *e = nullptr;
+ for (auto &it : *pcli->events)
+ if (it->hContact == hContact && it->hDbEvent == hDbEvent) {
+ e = it;
break;
- }
+ }
// Event was not found
- if (i == pcli->events->getCount())
+ if (e == nullptr)
return 1;
// remove event from the notify menu
- int iMenuId = (*pcli->events)[i].menuId;
+ int iMenuId = e->menuId;
if (iMenuId > 0) {
MENUITEMINFO mii = { 0 };
mii.cbSize = sizeof(mii);
|