diff options
author | George Hazan <george.hazan@gmail.com> | 2013-04-09 21:40:22 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-04-09 21:40:22 +0000 |
commit | 3dc0d9b0b7c30ea2f77d74c4ce5b6ccd67bd525c (patch) | |
tree | efee912ee654baafeb98efcd117921db6b7489bc /plugins/Weather/src/weather_mwin.cpp | |
parent | bcb27264ba737778e5d3edad36088bacf74f0236 (diff) |
- the kernel filters out contacts by proto names much faster than a plugin;
- database cycles simplified
git-svn-id: http://svn.miranda-ng.org/main/trunk@4404 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Weather/src/weather_mwin.cpp')
-rw-r--r-- | plugins/Weather/src/weather_mwin.cpp | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/plugins/Weather/src/weather_mwin.cpp b/plugins/Weather/src/weather_mwin.cpp index 7f70b659d0..c127214999 100644 --- a/plugins/Weather/src/weather_mwin.cpp +++ b/plugins/Weather/src/weather_mwin.cpp @@ -384,25 +384,19 @@ void InitMwin(void) FontRegisterT(&fontid);
}
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
- // see if the contact is a weather contact
- if (IsMyContact(hContact)) {
- if (db_get_dw(hContact, WEATHERPROTONAME, "mwin", 0))
- addWindow(hContact);
- }
- }
+ for (HANDLE hContact = db_find_first(WEATHERPROTONAME); hContact; hContact = db_find_next(hContact, WEATHERPROTONAME))
+ if (db_get_dw(hContact, WEATHERPROTONAME, "mwin", 0))
+ addWindow(hContact);
+
hFontHook = HookEvent(ME_FONT_RELOAD, RedrawFrame);
}
void DestroyMwin(void)
{
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
- // see if the contact is a weather contact
- if (IsMyContact(hContact)) {
- DWORD frameId = db_get_dw(hContact, WEATHERPROTONAME, "mwin", 0);
- if (frameId)
- CallService(MS_CLIST_FRAMES_REMOVEFRAME, frameId, 0);
- }
+ for (HANDLE hContact = db_find_first(WEATHERPROTONAME); hContact; hContact = db_find_next(hContact, WEATHERPROTONAME)) {
+ DWORD frameId = db_get_dw(hContact, WEATHERPROTONAME, "mwin", 0);
+ if (frameId)
+ CallService(MS_CLIST_FRAMES_REMOVEFRAME, frameId, 0);
}
UnregisterClass( _T("WeatherFrame"), hInst);
UnhookEvent(hFontHook);
|