summaryrefslogtreecommitdiff
path: root/protocols/Weather
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-10-10 07:46:53 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-10-10 07:46:53 +0000
commitf90be5cdeec5875d1022e1ef35f5b101bd76ac84 (patch)
tree59e5e8bf3b6a87dbee148bd63f841a8a62daac5f /protocols/Weather
parented10055737300c07e485eb22b27ccf92ffadab7c (diff)
service call replaced with the direct function call
git-svn-id: http://svn.miranda-ng.org/main/trunk@1857 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Weather')
-rw-r--r--protocols/Weather/weather_addstn.cpp4
-rw-r--r--protocols/Weather/weather_contacts.cpp4
-rw-r--r--protocols/Weather/weather_data.cpp4
-rw-r--r--protocols/Weather/weather_mwin.cpp8
-rw-r--r--protocols/Weather/weather_update.cpp4
5 files changed, 12 insertions, 12 deletions
diff --git a/protocols/Weather/weather_addstn.cpp b/protocols/Weather/weather_addstn.cpp
index 363dd8240d..31a83f75fc 100644
--- a/protocols/Weather/weather_addstn.cpp
+++ b/protocols/Weather/weather_addstn.cpp
@@ -37,7 +37,7 @@ INT_PTR WeatherAddToList(WPARAM wParam, LPARAM lParam)
WIDATA *sData;
// search for existing contact
- HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ HANDLE hContact = db_find_first();
while (hContact != NULL) {
// check if it is a weather contact
if ( IsMyContact(hContact)) {
@@ -58,7 +58,7 @@ INT_PTR WeatherAddToList(WPARAM wParam, LPARAM lParam)
DBFreeVariant(&dbv);
}
}
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0);
+ hContact = db_find_next(hContact);
}
// if contact with the same ID was not found, add it
diff --git a/protocols/Weather/weather_contacts.cpp b/protocols/Weather/weather_contacts.cpp
index 06c7463fe3..9111ea3d92 100644
--- a/protocols/Weather/weather_contacts.cpp
+++ b/protocols/Weather/weather_contacts.cpp
@@ -447,7 +447,7 @@ int ContactDeleted(WPARAM wParam, LPARAM lParam)
// now the default station is deleted, try to get a new one
// start looking for other weather stations
- HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ HANDLE hContact = db_find_first();
while(hContact) {
if (IsMyContact(hContact)) {
if (!DBGetContactSettingTString(hContact, WEATHERPROTONAME, "ID", &dbv)) {
@@ -469,7 +469,7 @@ int ContactDeleted(WPARAM wParam, LPARAM lParam)
DBFreeVariant(&dbv);
}
}
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0);
+ hContact = db_find_next(hContact);
}
// got here if no more weather station left
opt.Default[0] = 0; // no default station
diff --git a/protocols/Weather/weather_data.cpp b/protocols/Weather/weather_data.cpp
index b1ae960bd7..3fadde88e7 100644
--- a/protocols/Weather/weather_data.cpp
+++ b/protocols/Weather/weather_data.cpp
@@ -131,7 +131,7 @@ void EraseAllInfo(DWORD lastver)
HANDLE hContact, LastContact = NULL;
DBVARIANT dbv;
// loop through all contacts
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ hContact = db_find_first();
while(hContact)
{
// see if the contact is a weather contact
@@ -183,7 +183,7 @@ void EraseAllInfo(DWORD lastver)
ContactCount++; // increment counter
LastContact = hContact;
}
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0);
+ hContact = db_find_next(hContact);
}
// if weather contact exists, set the status to online so it is ready for update
// if (ContactCount != 0) status = ONLINE;
diff --git a/protocols/Weather/weather_mwin.cpp b/protocols/Weather/weather_mwin.cpp
index fb02af94a9..c5fa204f85 100644
--- a/protocols/Weather/weather_mwin.cpp
+++ b/protocols/Weather/weather_mwin.cpp
@@ -386,7 +386,7 @@ void InitMwin(void)
FontRegisterT(&fontid);
}
- HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ HANDLE hContact = db_find_first();
while(hContact)
{
// see if the contact is a weather contact
@@ -395,14 +395,14 @@ void InitMwin(void)
if (DBGetContactSettingDword(hContact, WEATHERPROTONAME, "mwin", 0))
addWindow(hContact);
}
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0);
+ hContact = db_find_next(hContact);
}
hFontHook = HookEvent(ME_FONT_RELOAD, RedrawFrame);
}
void DestroyMwin(void)
{
- HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ HANDLE hContact = db_find_first();
while(hContact)
{
// see if the contact is a weather contact
@@ -412,7 +412,7 @@ void DestroyMwin(void)
if (frameId)
CallService(MS_CLIST_FRAMES_REMOVEFRAME, frameId, 0);
}
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0);
+ hContact = db_find_next(hContact);
}
UnregisterClass( _T("WeatherFrame"), hInst);
UnhookEvent(hFontHook);
diff --git a/protocols/Weather/weather_update.cpp b/protocols/Weather/weather_update.cpp
index c4c78edec8..48ed3d84c2 100644
--- a/protocols/Weather/weather_update.cpp
+++ b/protocols/Weather/weather_update.cpp
@@ -284,7 +284,7 @@ void DestroyUpdateList(void)
void UpdateAll(BOOL AutoUpdate, BOOL RemoveData)
{
// add all weather contact to the update queue list
- HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ HANDLE hContact = db_find_first();
while (hContact != NULL)
{
if (IsMyContact(hContact))
@@ -295,7 +295,7 @@ void UpdateAll(BOOL AutoUpdate, BOOL RemoveData)
UpdateListAdd(hContact);
}
}
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0);
+ hContact = db_find_next(hContact);
}
// if it is not updating, then start the update thread process