diff options
author | Rozhuk Ivan <rozhuk.im@gmail.com> | 2015-07-12 05:14:50 +0000 |
---|---|---|
committer | Rozhuk Ivan <rozhuk.im@gmail.com> | 2015-07-12 05:14:50 +0000 |
commit | efb5fdfa3f31b1c57b9253cd2d062e61d9574c37 (patch) | |
tree | f45d9f463b8d5108340251e174551411cd6e0505 /plugins/WhenWasIt/src/hooked_events.cpp | |
parent | 53ed793fb92d7a7175eda46aad41b30228bac44f (diff) |
WhenWasIt: timers code update
git-svn-id: http://svn.miranda-ng.org/main/trunk@14539 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/WhenWasIt/src/hooked_events.cpp')
-rw-r--r-- | plugins/WhenWasIt/src/hooked_events.cpp | 29 |
1 files changed, 10 insertions, 19 deletions
diff --git a/plugins/WhenWasIt/src/hooked_events.cpp b/plugins/WhenWasIt/src/hooked_events.cpp index a421260b7e..ebc715a279 100644 --- a/plugins/WhenWasIt/src/hooked_events.cpp +++ b/plugins/WhenWasIt/src/hooked_events.cpp @@ -24,10 +24,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define EXCLUDE_HIDDEN 1
#define EXCLUDE_IGNORED 2
-UINT_PTR hCheckTimer = NULL;
-UINT_PTR hDateChangeTimer = NULL;
+static UINT_PTR hCheckTimer = NULL;
+static UINT_PTR hDateChangeTimer = NULL;
+static int currentDay = 0;
-int currentDay;
static int OnTopToolBarModuleLoaded(WPARAM, LPARAM)
{
@@ -145,31 +145,22 @@ int RefreshContactListIcons(MCONTACT hContact) int UpdateTimers()
{
- if (hCheckTimer) {
- KillTimer(NULL, hCheckTimer);
- hCheckTimer = NULL;
- }
-
- long interval = db_get_dw(NULL, ModuleName, "Interval", CHECK_INTERVAL);
- interval *= 1000 * 60 * 60; //go from miliseconds to hours
+ UINT interval = db_get_dw(NULL, ModuleName, "Interval", CHECK_INTERVAL);
+ interval *= (1000 * 60 * 60); //go from miliseconds to hours
hCheckTimer = SetTimer(NULL, 0, interval, OnCheckTimer);
if (!hDateChangeTimer)
- hDateChangeTimer = SetTimer(NULL, 0, 1000 * DATE_CHANGE_CHECK_INTERVAL, OnDateChangeTimer);
+ hDateChangeTimer = SetTimer(NULL, 0, (1000 * DATE_CHANGE_CHECK_INTERVAL), OnDateChangeTimer);
return 0;
}
int KillTimers()
{
- if (hCheckTimer) {
- KillTimer(NULL, hCheckTimer);
- hCheckTimer = NULL;
- }
+ KillTimer(NULL, hCheckTimer);
+ hCheckTimer = NULL;
- if (hDateChangeTimer) {
- KillTimer(NULL, hDateChangeTimer);
- hDateChangeTimer = NULL;
- }
+ KillTimer(NULL, hDateChangeTimer);
+ hDateChangeTimer = NULL;
return 0;
}
|