summaryrefslogtreecommitdiff
path: root/plugins/XSoundNotify/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-11-12 21:44:56 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-11-12 21:44:56 +0300
commit53fe3e46177d17b4941610de19f5cc6210700cb4 (patch)
treeb67a6bc208dad141f9db14035cd7e42ff2a51872 /plugins/XSoundNotify/src
parent488214ac8af0c4aeb1a5c1d8fd48368daaf4c4c7 (diff)
db_* functions replaced with g_plugin calls
Diffstat (limited to 'plugins/XSoundNotify/src')
-rw-r--r--plugins/XSoundNotify/src/options.cpp16
-rw-r--r--plugins/XSoundNotify/src/xsn_main.cpp8
2 files changed, 12 insertions, 12 deletions
diff --git a/plugins/XSoundNotify/src/options.cpp b/plugins/XSoundNotify/src/options.cpp
index bbbad8fe54..da6828ce61 100644
--- a/plugins/XSoundNotify/src/options.cpp
+++ b/plugins/XSoundNotify/src/options.cpp
@@ -97,7 +97,7 @@ static INT_PTR CALLBACK OptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
if (!cursel) {
PROTOACCOUNT *pa = (PROTOACCOUNT *)SendDlgItemMessage(hwndDlg, IDC_OPT_COMBO_PROTO, CB_GETITEMDATA, cursel, 0);
DBVARIANT dbv = { 0 };
- if (!db_get_ws(NULL, MODULENAME, pa->szModuleName, &dbv)) {
+ if (!g_plugin.getWString(pa->szModuleName, &dbv)) {
EnableWindow(GetDlgItem(hwndDlg, IDC_OPT_BUTTON_TEST_PLAY), TRUE);
EnableWindow(GetDlgItem(hwndDlg, IDC_OPT_BUTTON_RESET_SOUND), TRUE);
SetDlgItemText(hwndDlg, IDC_OPT_LABEL_SOUND, PathFindFileName(dbv.pwszVal));
@@ -111,7 +111,7 @@ static INT_PTR CALLBACK OptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
size_t value_max_len = mir_strlen(pa->szModuleName) + 8;
char *value = (char *)mir_alloc(sizeof(char) * value_max_len);
mir_snprintf(value, value_max_len, "%s_ignore", pa->szModuleName);
- CheckDlgButton(hwndDlg, IDC_OPT_IGNORE_SOUND, db_get_b(NULL, MODULENAME, value, 0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_OPT_IGNORE_SOUND, g_plugin.getByte(value, 0) ? BST_CHECKED : BST_UNCHECKED);
mir_free(value);
}
else {
@@ -200,7 +200,7 @@ static INT_PTR CALLBACK OptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
isIgnoreSound = 0;
if (p == nullptr) {
DBVARIANT dbv;
- if (!db_get_ws(NULL, MODULENAME, pa->szModuleName, &dbv)) {
+ if (!g_plugin.getWString(pa->szModuleName, &dbv)) {
wchar_t longpath[MAX_PATH];
PathToAbsoluteW(dbv.pwszVal, longpath);
Skin_PlaySoundFile(longpath);
@@ -250,11 +250,11 @@ static INT_PTR CALLBACK OptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
delete p;
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
}
- db_unset(NULL, MODULENAME, pa->szModuleName);
+ g_plugin.delSetting(pa->szModuleName);
size_t value_max_len = mir_strlen(pa->szModuleName) + 8;
char *value = (char *)mir_alloc(sizeof(char) * value_max_len);
mir_snprintf(value, value_max_len, "%s_ignore", pa->szModuleName);
- db_unset(NULL, MODULENAME, value);
+ g_plugin.delSetting(value);
mir_free(value);
}
else {
@@ -279,7 +279,7 @@ static INT_PTR CALLBACK OptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
XSN_Data *p = XSN_Users.find((XSN_Data *)&pa->szModuleName);
if (p == nullptr) {
DBVARIANT dbv;
- if (!db_get_ws(NULL, MODULENAME, pa->szModuleName, &dbv)) {
+ if (!g_plugin.getWString(pa->szModuleName, &dbv)) {
wchar_t longpath[MAX_PATH];
PathToAbsoluteW(dbv.pwszVal, longpath);
XSN_Users.insert(new XSN_Data((LPARAM)pa->szModuleName, longpath, IsDlgButtonChecked(hwndDlg, IDC_OPT_IGNORE_SOUND) ? 1 : 0, 0));
@@ -322,7 +322,7 @@ static INT_PTR CALLBACK OptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
if (it->iscontact)
db_set_ws(it->hContact, MODULENAME, SETTINGSKEY, shortpath);
else
- db_set_ws(NULL, MODULENAME, (LPCSTR)it->hContact, shortpath);
+ g_plugin.setWString((LPCSTR)it->hContact, shortpath);
}
if (it->iscontact)
db_set_b(it->hContact, MODULENAME, SETTINGSIGNOREKEY, it->ignore);
@@ -330,7 +330,7 @@ static INT_PTR CALLBACK OptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
size_t value_max_len = mir_strlen((const char*)it->hContact) + 8;
char *value = (char *)mir_alloc(sizeof(char) * value_max_len);
mir_snprintf(value, value_max_len, "%s_ignore", (const char*)it->hContact);
- db_set_b(NULL, MODULENAME, value, it->ignore);
+ g_plugin.setByte(value, it->ignore);
mir_free(value);
}
}
diff --git a/plugins/XSoundNotify/src/xsn_main.cpp b/plugins/XSoundNotify/src/xsn_main.cpp
index c29a1ea852..1991619bd8 100644
--- a/plugins/XSoundNotify/src/xsn_main.cpp
+++ b/plugins/XSoundNotify/src/xsn_main.cpp
@@ -121,9 +121,9 @@ static int ProcessEvent(WPARAM hContact, LPARAM lParam)
size_t value_max_len = mir_strlen(pa->szModuleName) + 8;
char *value = (char *)mir_alloc(sizeof(char) * value_max_len);
mir_snprintf(value, value_max_len, "%s_ignore", pa->szModuleName);
- isIgnoreAccSound = db_get_b(NULL, MODULENAME, value, 0);
+ isIgnoreAccSound = g_plugin.getByte(value, 0);
mir_free(value);
- if (!isIgnoreAccSound && !db_get_ws(NULL, MODULENAME, pa->szModuleName, &dbv)) {
+ if (!isIgnoreAccSound && !g_plugin.getWString(pa->szModuleName, &dbv)) {
wchar_t PlaySoundPath[MAX_PATH] = { 0 };
PathToAbsoluteW(dbv.pwszVal, PlaySoundPath);
isAccSound = 0;
@@ -165,9 +165,9 @@ static int ProcessChatEvent(WPARAM, LPARAM lParam)
size_t value_max_len = mir_strlen(pa->szModuleName) + 8;
char *value = (char *)mir_alloc(sizeof(char) * value_max_len);
mir_snprintf(value, value_max_len, "%s_ignore", pa->szModuleName);
- isIgnoreAccSound = db_get_b(NULL, MODULENAME, value, 0);
+ isIgnoreAccSound = g_plugin.getByte(value, 0);
mir_free(value);
- if (!isIgnoreAccSound && !db_get_ws(NULL, MODULENAME, pa->szModuleName, &dbv)) {
+ if (!isIgnoreAccSound && !g_plugin.getWString(pa->szModuleName, &dbv)) {
wchar_t PlaySoundPath[MAX_PATH] = { 0 };
PathToAbsoluteW(dbv.pwszVal, PlaySoundPath);
isAccSound = 0;