From 3dc0d9b0b7c30ea2f77d74c4ce5b6ccd67bd525c Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 9 Apr 2013 21:40:22 +0000 Subject: - 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 --- plugins/Weather/src/weather_mwin.cpp | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) (limited to 'plugins/Weather/src/weather_mwin.cpp') 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); -- cgit v1.2.3