diff options
author | George Hazan <ghazan@miranda.im> | 2018-02-21 18:36:32 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-02-21 18:40:14 +0300 |
commit | 6e96535fdbb886dcad1a3396659b368283922e64 (patch) | |
tree | ef1a35a5ca0c43fcf10a1190a47853588e90cddc /protocols/JabberG/src/jabber_xstatus.h | |
parent | fd23a292afc4aa760a0ff8ab646eebe5942fb06d (diff) |
Jabber: C++'11 iterators
Diffstat (limited to 'protocols/JabberG/src/jabber_xstatus.h')
-rw-r--r-- | protocols/JabberG/src/jabber_xstatus.h | 38 |
1 files changed, 18 insertions, 20 deletions
diff --git a/protocols/JabberG/src/jabber_xstatus.h b/protocols/JabberG/src/jabber_xstatus.h index 62b805829a..b74a80b62d 100644 --- a/protocols/JabberG/src/jabber_xstatus.h +++ b/protocols/JabberG/src/jabber_xstatus.h @@ -66,56 +66,54 @@ public: void ProcessEvent(const wchar_t *from, HXML eventNode)
{
- for (int i=0; i < getCount(); i++)
- {
- CPepService &pepSvc = (*this)[i];
- HXML itemsNode = XmlGetChildByTag(eventNode, L"items", L"node", pepSvc.GetNode());
+ for (auto &it : *this) {
+ HXML itemsNode = XmlGetChildByTag(eventNode, L"items", L"node", it->GetNode());
if (itemsNode)
- pepSvc.ProcessItems(from, itemsNode);
+ it->ProcessItems(from, itemsNode);
}
}
void InitGui()
{
- for (int i=0; i < getCount(); i++)
- (*this)[i].InitGui();
+ for (auto &it : *this)
+ it->InitGui();
}
void RebuildMenu()
{
- for (int i=0; i < getCount(); i++)
- (*this)[i].RebuildMenu();
+ for (auto &it : *this)
+ it->RebuildMenu();
}
void ResetExtraIcon(MCONTACT hContact)
{
- for (int i=0; i < getCount(); i++)
- (*this)[i].ResetExtraIcon(hContact);
+ for (auto &it : *this)
+ it->ResetExtraIcon(hContact);
}
void PublishAll()
{
- for (int i=0; i < getCount(); i++)
- (*this)[i].Publish();
+ for (auto &it : *this)
+ it->Publish();
}
void RetractAll()
{
- for (int i=0; i < getCount(); i++)
- (*this)[i].Retract();
+ for (auto &it : *this)
+ it->Retract();
}
void ResetPublishAll()
{
- for(int i=0; i < getCount(); i++)
- (*this)[i].ResetPublish();
+ for (auto &it : *this)
+ it->ResetPublish();
}
CPepService *Find(wchar_t *node)
{
- for (int i=0; i < getCount(); i++)
- if (!mir_wstrcmp((*this)[i].GetNode(), node))
- return &((*this)[i]);
+ for (auto &it : *this)
+ if (!mir_wstrcmp(it->GetNode(), node))
+ return it;
return nullptr;
}
};
|