summaryrefslogtreecommitdiff
path: root/plugins/Variables
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/Variables
parent488214ac8af0c4aeb1a5c1d8fd48368daaf4c4c7 (diff)
db_* functions replaced with g_plugin calls
Diffstat (limited to 'plugins/Variables')
-rw-r--r--plugins/Variables/src/help.cpp12
-rw-r--r--plugins/Variables/src/options.cpp20
-rw-r--r--plugins/Variables/src/variables.cpp10
3 files changed, 21 insertions, 21 deletions
diff --git a/plugins/Variables/src/help.cpp b/plugins/Variables/src/help.cpp
index 582b8d8da0..d36f6bdfaf 100644
--- a/plugins/Variables/src/help.cpp
+++ b/plugins/Variables/src/help.cpp
@@ -91,7 +91,7 @@ static INT_PTR CALLBACK extratextDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPA
// dialog box for the %subject% selection
void ResetCList(HWND hwndDlg)
{
- SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_SETUSEGROUPS, db_get_b(NULL, "CList", "UseGroups", SETTING_USEGROUPS_DEFAULT), 0);
+ SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_SETUSEGROUPS, db_get_b(0, "CList", "UseGroups", SETTING_USEGROUPS_DEFAULT), 0);
SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_SETHIDEEMPTYGROUPS, 1, 0);
}
@@ -127,7 +127,7 @@ static INT_PTR CALLBACK clistDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM
MCONTACT hItem, hContact = wParam;
log_debugA("VARM_SETSUBJECT: %u", hContact);
if (hContact == INVALID_CONTACT_ID) {
- wchar_t *tszContact = db_get_wsa(NULL, MODULENAME, SETTING_SUBJECT);
+ wchar_t *tszContact = g_plugin.getWStringA(SETTING_SUBJECT);
log_debugA("VARM_SETSUBJECT: %s", tszContact);
if (tszContact != nullptr) {
hContact = getContactFromString(tszContact, CI_PROTOID);
@@ -196,13 +196,13 @@ static INT_PTR CALLBACK clistDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM
break;
case WM_DESTROY:
- db_unset(NULL, MODULENAME, SETTING_SUBJECT);
+ g_plugin.delSetting(SETTING_SUBJECT);
MCONTACT hContact = (MCONTACT)SendMessage(hwndDlg, VARM_GETSUBJECT, 0, 0);
if (hContact != NULL) {
wchar_t *tszContact = encodeContactToString(hContact);
if (tszContact != nullptr) {
- db_set_ws(NULL, MODULENAME, SETTING_SUBJECT, tszContact);
+ g_plugin.setWString(SETTING_SUBJECT, tszContact);
mir_free(tszContact);
} }
break;
@@ -583,7 +583,7 @@ static INT_PTR CALLBACK inputDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM
memset(dat, 0, sizeof(INPUTDLGDATA));
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)dat);
// splitter things
- dat->splitterPos = (INT_PTR)db_get_dw(NULL, MODULENAME, SETTING_SPLITTERPOS, -1);
+ dat->splitterPos = (INT_PTR)g_plugin.getDword(SETTING_SPLITTERPOS, -1);
{
RECT rc;
POINT pt;
@@ -718,7 +718,7 @@ static INT_PTR CALLBACK inputDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM
KillTimer(hwndDlg, IDT_PARSE);
if (dat == nullptr)
break;
- db_set_dw(NULL, MODULENAME, SETTING_SPLITTERPOS, dat->splitterPos);
+ g_plugin.setDword(SETTING_SPLITTERPOS, dat->splitterPos);
mir_free(dat);
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, 0);
break;
diff --git a/plugins/Variables/src/options.cpp b/plugins/Variables/src/options.cpp
index ed4bf81e07..116bd46b14 100644
--- a/plugins/Variables/src/options.cpp
+++ b/plugins/Variables/src/options.cpp
@@ -26,15 +26,15 @@ static INT_PTR CALLBACK SetOptsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP
TranslateDialogDefault(hwndDlg);
DBVARIANT dbv;
- if (!db_get_ws(NULL, MODULENAME, SETTING_STARTUPTEXT, &dbv)) {
+ if (!g_plugin.getWString(SETTING_STARTUPTEXT, &dbv)) {
SetDlgItemText(hwndDlg, IDC_FORMATTEXT, dbv.pwszVal);
db_free(&dbv);
}
- CheckDlgButton(hwndDlg, IDC_PARSEATSTARTUP, db_get_b(NULL, MODULENAME, SETTING_PARSEATSTARTUP, 0) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_STRIPCRLF, db_get_b(NULL, MODULENAME, SETTING_STRIPCRLF, 0) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_STRIPWS, db_get_b(NULL, MODULENAME, SETTING_STRIPWS, 0) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_STRIPALL, db_get_b(NULL, MODULENAME, SETTING_STRIPALL, 0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_PARSEATSTARTUP, g_plugin.getByte(SETTING_PARSEATSTARTUP, 0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_STRIPCRLF, g_plugin.getByte(SETTING_STRIPCRLF, 0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_STRIPWS, g_plugin.getByte(SETTING_STRIPWS, 0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_STRIPALL, g_plugin.getByte(SETTING_STRIPALL, 0) ? BST_CHECKED : BST_UNCHECKED);
EnableWindow(GetDlgItem(hwndDlg, IDC_STRIPCRLF), IsDlgButtonChecked(hwndDlg, IDC_STRIPALL) ? FALSE : TRUE);
EnableWindow(GetDlgItem(hwndDlg, IDC_STRIPWS), IsDlgButtonChecked(hwndDlg, IDC_STRIPALL) ? FALSE : TRUE);
variables_skin_helpbutton(hwndDlg, IDC_SHOWHELP);
@@ -90,14 +90,14 @@ static INT_PTR CALLBACK SetOptsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP
break;
if (GetDlgItemText(hwndDlg, IDC_FORMATTEXT, szFormatText, len + 1) != 0)
- db_set_ws(NULL, MODULENAME, SETTING_STARTUPTEXT, szFormatText);
+ g_plugin.setWString(SETTING_STARTUPTEXT, szFormatText);
mir_free(szFormatText);
}
- db_set_b(NULL, MODULENAME, SETTING_PARSEATSTARTUP, (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_PARSEATSTARTUP) ? 1 : 0));
- db_set_b(NULL, MODULENAME, SETTING_STRIPCRLF, (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_STRIPCRLF) ? 1 : 0));
- db_set_b(NULL, MODULENAME, SETTING_STRIPWS, (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_STRIPWS) ? 1 : 0));
- db_set_b(NULL, MODULENAME, SETTING_STRIPALL, (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_STRIPALL) ? 1 : 0));
+ g_plugin.setByte(SETTING_PARSEATSTARTUP, (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_PARSEATSTARTUP) ? 1 : 0));
+ g_plugin.setByte(SETTING_STRIPCRLF, (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_STRIPCRLF) ? 1 : 0));
+ g_plugin.setByte(SETTING_STRIPWS, (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_STRIPWS) ? 1 : 0));
+ g_plugin.setByte(SETTING_STRIPALL, (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_STRIPALL) ? 1 : 0));
}
break;
diff --git a/plugins/Variables/src/variables.cpp b/plugins/Variables/src/variables.cpp
index 2db71497a4..479f18d34b 100644
--- a/plugins/Variables/src/variables.cpp
+++ b/plugins/Variables/src/variables.cpp
@@ -368,9 +368,9 @@ int setParseOptions(struct ParseOptions *po)
po = &gParseOpts;
memset(po, 0, sizeof(struct ParseOptions));
- if (!db_get_b(NULL, MODULENAME, SETTING_STRIPALL, 0)) {
- po->bStripEOL = db_get_b(NULL, MODULENAME, SETTING_STRIPCRLF, 0);
- po->bStripWS = db_get_b(NULL, MODULENAME, SETTING_STRIPWS, 0);
+ if (!g_plugin.getByte(SETTING_STRIPALL, 0)) {
+ po->bStripEOL = g_plugin.getByte(SETTING_STRIPCRLF, 0);
+ po->bStripWS = g_plugin.getByte(SETTING_STRIPWS, 0);
}
else po->bStripAll = TRUE;
@@ -418,10 +418,10 @@ int LoadVarModule()
log_debugA("Variables: Internal tokens registered");
- if (db_get_b(NULL, MODULENAME, SETTING_PARSEATSTARTUP, 0)) {
+ if (g_plugin.getByte(SETTING_PARSEATSTARTUP, 0)) {
FORMATINFO fi = { 0 };
fi.cbSize = sizeof(fi);
- fi.szFormat.w = db_get_wsa(NULL, MODULENAME, SETTING_STARTUPTEXT);
+ fi.szFormat.w = g_plugin.getWStringA(SETTING_STARTUPTEXT);
if (fi.szFormat.w != nullptr) {
mir_free(formatString(&fi));
mir_free(fi.szFormat.w);