summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-11-28 22:02:25 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-11-28 22:02:25 +0000
commit0392fb947b5b95e4595ab9508d01a795a2b0e057 (patch)
tree4ad03ba664fca561c175e3f5e8fcdf9acdee732d
parent6c0f44853a62542f276f747998a9367e285bc212 (diff)
old db reading code removed
git-svn-id: http://svn.miranda-ng.org/main/trunk@11139 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--plugins/KeyboardNotify/src/main.cpp29
1 files changed, 8 insertions, 21 deletions
diff --git a/plugins/KeyboardNotify/src/main.cpp b/plugins/KeyboardNotify/src/main.cpp
index 73ea6cf54b..861e25d66b 100644
--- a/plugins/KeyboardNotify/src/main.cpp
+++ b/plugins/KeyboardNotify/src/main.cpp
@@ -327,12 +327,9 @@ static void FlashThreadFunction()
if (wStartDelay > 0)
Sleep(wStartDelay * 1000);
dwFlashStarted = GetTickCount();
-
}
-
}
-
BOOL checkMsgTimestamp(MCONTACT hContact, HANDLE hEventCurrent, DWORD timestampCurrent)
{
if (!bFlashIfMsgOlder)
@@ -529,26 +526,16 @@ void StartBlinkAction(char *flashSequence, WORD eventMaxSeconds)
void createProcessList(void)
{
- DBVARIANT dbv;
- unsigned int i, count;
-
- count = (unsigned int)db_get_w(NULL, KEYBDMODULE, "processcount", 0);
+ int count = db_get_w(NULL, KEYBDMODULE, "processcount", 0);
ProcessList.count = 0;
ProcessList.szFileName = (TCHAR **)malloc(count * sizeof(TCHAR *));
if (ProcessList.szFileName) {
- for (i=0; i < count; i++)
- if (db_get_ts(NULL, KEYBDMODULE, fmtDBSettingName("process%d", i), &dbv))
- ProcessList.szFileName[i] = NULL;
- else {
- ProcessList.szFileName[i] = (TCHAR *)malloc((wcslen(dbv.ptszVal) + 1)*sizeof(TCHAR));
- if (ProcessList.szFileName[i])
- wcscpy(ProcessList.szFileName[i], dbv.ptszVal);
- db_free(&dbv);
- }
+ for (int i=0; i < count; i++)
+ ProcessList.szFileName[i] = db_get_tsa(NULL, KEYBDMODULE, fmtDBSettingName("process%d", i));
+
ProcessList.count = count;
}
-
}
@@ -556,11 +543,11 @@ void destroyProcessList(void)
{
if (ProcessList.szFileName == NULL)
return;
- for (int i = 0; i < ProcessList.count; i ++) {
- if (ProcessList.szFileName[i]) {
+
+ for (int i = 0; i < ProcessList.count; i++)
+ if (ProcessList.szFileName[i])
free(ProcessList.szFileName[i]);
- }
- }
+
free(ProcessList.szFileName);
ProcessList.count = 0;
ProcessList.szFileName = NULL;