summaryrefslogtreecommitdiff
path: root/plugins/ListeningTo
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-03-16 20:01:14 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-03-16 20:01:14 +0300
commit39390b02dbd5aa7eb21a83773fa561b39f8828bc (patch)
tree7982eda1257f7466b5663c2865fdb7804c397257 /plugins/ListeningTo
parent5046973a41e412afd06d6a78a3b9bce226e3cf50 (diff)
always hated these long expressions: contact_iter makes them much shorter
Diffstat (limited to 'plugins/ListeningTo')
-rw-r--r--plugins/ListeningTo/src/listeningto.cpp2
-rw-r--r--plugins/ListeningTo/src/players/mradio.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/plugins/ListeningTo/src/listeningto.cpp b/plugins/ListeningTo/src/listeningto.cpp
index ad77475d8a..47c452af1a 100644
--- a/plugins/ListeningTo/src/listeningto.cpp
+++ b/plugins/ListeningTo/src/listeningto.cpp
@@ -178,7 +178,7 @@ int ModulesLoaded(WPARAM, LPARAM)
EnableDisablePlayers();
- for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (auto &hContact : contact_iter()) {
char *proto = GetContactProto(hContact);
if (proto != nullptr) {
DBVARIANT dbv;
diff --git a/plugins/ListeningTo/src/players/mradio.cpp b/plugins/ListeningTo/src/players/mradio.cpp
index 60a88ec252..b65a7e2db4 100644
--- a/plugins/ListeningTo/src/players/mradio.cpp
+++ b/plugins/ListeningTo/src/players/mradio.cpp
@@ -34,7 +34,7 @@ void MRadio::EnableDisable()
int MRadio::GetData()
{
- for (MCONTACT hContact = db_find_first("mRadio"); hContact; hContact = db_find_next(hContact, "mRadio")) {
+ for (auto &hContact : contact_iter("mRadio")) {
WORD status = db_get_w(hContact, "mRadio", "Status", ID_STATUS_OFFLINE);
if (status != ID_STATUS_ONLINE)
continue;