summaryrefslogtreecommitdiff
path: root/plugins/Weather/src
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Weather/src')
-rw-r--r--plugins/Weather/src/weather_addstn.cpp2
-rw-r--r--plugins/Weather/src/weather_contacts.cpp2
-rw-r--r--plugins/Weather/src/weather_data.cpp2
-rw-r--r--plugins/Weather/src/weather_mwin.cpp4
-rw-r--r--plugins/Weather/src/weather_update.cpp2
5 files changed, 6 insertions, 6 deletions
diff --git a/plugins/Weather/src/weather_addstn.cpp b/plugins/Weather/src/weather_addstn.cpp
index 0393364663..87825b72a5 100644
--- a/plugins/Weather/src/weather_addstn.cpp
+++ b/plugins/Weather/src/weather_addstn.cpp
@@ -39,7 +39,7 @@ INT_PTR WeatherAddToList(WPARAM, LPARAM lParam)
return 0;
// search for existing contact
- for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (auto &hContact : contact_iter()) {
// check if it is a weather contact
if (IsMyContact(hContact)) {
DBVARIANT dbv;
diff --git a/plugins/Weather/src/weather_contacts.cpp b/plugins/Weather/src/weather_contacts.cpp
index 17a2708092..647e855e99 100644
--- a/plugins/Weather/src/weather_contacts.cpp
+++ b/plugins/Weather/src/weather_contacts.cpp
@@ -444,7 +444,7 @@ int ContactDeleted(WPARAM wParam, LPARAM)
// now the default station is deleted, try to get a new one
// start looking for other weather stations
- for (MCONTACT hContact = db_find_first(WEATHERPROTONAME); hContact; hContact = db_find_next(hContact, WEATHERPROTONAME)) {
+ for (auto &hContact : contact_iter(WEATHERPROTONAME)) {
tszID = db_get_wsa(hContact, WEATHERPROTONAME, "ID");
if (tszID == NULL)
continue;
diff --git a/plugins/Weather/src/weather_data.cpp b/plugins/Weather/src/weather_data.cpp
index 28fa9a622d..90a8a05c0a 100644
--- a/plugins/Weather/src/weather_data.cpp
+++ b/plugins/Weather/src/weather_data.cpp
@@ -112,7 +112,7 @@ void EraseAllInfo()
MCONTACT LastContact = NULL;
DBVARIANT dbv;
// loop through all contacts
- for (MCONTACT hContact = db_find_first(WEATHERPROTONAME); hContact; hContact = db_find_next(hContact, WEATHERPROTONAME)) {
+ for (auto &hContact : contact_iter(WEATHERPROTONAME)) {
db_set_w(hContact, WEATHERPROTONAME, "Status", ID_STATUS_OFFLINE);
db_set_w(hContact, WEATHERPROTONAME, "StatusIcon", ID_STATUS_OFFLINE);
db_unset(hContact, "CList", "MyHandle");
diff --git a/plugins/Weather/src/weather_mwin.cpp b/plugins/Weather/src/weather_mwin.cpp
index c7377821ef..c219c2a9ca 100644
--- a/plugins/Weather/src/weather_mwin.cpp
+++ b/plugins/Weather/src/weather_mwin.cpp
@@ -348,7 +348,7 @@ void InitMwin(void)
mir_strcpy(fontid.prefix, "fnt1");
Font_RegisterW(&fontid);
- for (MCONTACT hContact = db_find_first(WEATHERPROTONAME); hContact; hContact = db_find_next(hContact, WEATHERPROTONAME))
+ for (auto &hContact : contact_iter(WEATHERPROTONAME))
if (db_get_dw(hContact, WEATHERPROTONAME, "mwin", 0))
addWindow(hContact);
@@ -357,7 +357,7 @@ void InitMwin(void)
void DestroyMwin(void)
{
- for (MCONTACT hContact = db_find_first(WEATHERPROTONAME); hContact; hContact = db_find_next(hContact, WEATHERPROTONAME)) {
+ for (auto &hContact : contact_iter(WEATHERPROTONAME)) {
DWORD frameId = db_get_dw(hContact, WEATHERPROTONAME, "mwin", 0);
if (frameId)
CallService(MS_CLIST_FRAMES_REMOVEFRAME, frameId, 0);
diff --git a/plugins/Weather/src/weather_update.cpp b/plugins/Weather/src/weather_update.cpp
index 07e69e5b5b..66feef7258 100644
--- a/plugins/Weather/src/weather_update.cpp
+++ b/plugins/Weather/src/weather_update.cpp
@@ -307,7 +307,7 @@ static void UpdateThreadProc(void *)
void UpdateAll(BOOL AutoUpdate, BOOL RemoveData)
{
// add all weather contact to the update queue list
- for (MCONTACT hContact = db_find_first(WEATHERPROTONAME); hContact; hContact = db_find_next(hContact, WEATHERPROTONAME))
+ for (auto &hContact : contact_iter(WEATHERPROTONAME))
if (!db_get_b(hContact, WEATHERPROTONAME, "AutoUpdate", FALSE) || !AutoUpdate) {
if (RemoveData)
DBDataManage(hContact, WDBM_REMOVE, 0, 0);