From 53fe3e46177d17b4941610de19f5cc6210700cb4 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 12 Nov 2018 21:44:56 +0300 Subject: db_* functions replaced with g_plugin calls --- plugins/MenuItemEx/src/main.cpp | 8 ++++---- plugins/MenuItemEx/src/options.cpp | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'plugins/MenuItemEx') diff --git a/plugins/MenuItemEx/src/main.cpp b/plugins/MenuItemEx/src/main.cpp index ab07749d10..c06be5f329 100644 --- a/plugins/MenuItemEx/src/main.cpp +++ b/plugins/MenuItemEx/src/main.cpp @@ -560,7 +560,7 @@ static INT_PTR onCopyID(WPARAM hContact, LPARAM) wchar_t szID[256], buffer[256]; GetID(hContact, szProto, szID, _countof(szID)); - if (db_get_dw(NULL, MODULENAME, "flags", vf_default) & VF_CIDN) { + if (g_plugin.getDword("flags", vf_default) & VF_CIDN) { PROTOACCOUNT *pa = Proto_GetAccount(szProto); if (!pa->bOldProto) mir_snwprintf(buffer, L"%s: %s", pa->tszAccountName, szID); @@ -578,7 +578,7 @@ static INT_PTR onCopyID(WPARAM hContact, LPARAM) static INT_PTR onCopyStatusMsg(WPARAM hContact, LPARAM) { - DWORD flags = db_get_dw(NULL, MODULENAME, "flags", vf_default); + DWORD flags = g_plugin.getDword("flags", vf_default); LPSTR module = GetContactProto(hContact); if (!module) @@ -704,7 +704,7 @@ static int isIgnored(MCONTACT hContact, int type) static INT_PTR onIgnore(WPARAM wparam, LPARAM lparam) { - if (db_get_b(NULL, MODULENAME, "ignorehide", 0) && (lparam == IGNOREEVENT_ALL)) + if (g_plugin.getByte("ignorehide", 0) && (lparam == IGNOREEVENT_ALL)) db_set_b((MCONTACT)wparam, "CList", "Hidden", (isIgnored((MCONTACT)wparam, lparam) ? (byte)0 : (byte)1)); CallService(isIgnored((MCONTACT)wparam, lparam) ? MS_IGNORE_UNIGNORE : MS_IGNORE_IGNORE, wparam, lparam); @@ -739,7 +739,7 @@ static void ModifySubmenuItem(HGENMENU hItem, int checked, int hidden) // called when the contact-menu is built static int BuildMenu(WPARAM wparam, LPARAM) { - DWORD flags = db_get_dw(NULL, MODULENAME, "flags", vf_default); + DWORD flags = g_plugin.getDword("flags", vf_default); int j = 0, all = 0, hide = 0; BOOL bIsOnline = FALSE, bShowAll = CTRL_IS_PRESSED; MCONTACT hContact = (MCONTACT)wparam; diff --git a/plugins/MenuItemEx/src/options.cpp b/plugins/MenuItemEx/src/options.cpp index 313ee51702..13512fff96 100644 --- a/plugins/MenuItemEx/src/options.cpp +++ b/plugins/MenuItemEx/src/options.cpp @@ -28,7 +28,7 @@ static const checkboxes[] = { INT_PTR CALLBACK OptionsProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam) { - DWORD flags = db_get_dw(NULL, MODULENAME, "flags", vf_default); + DWORD flags = g_plugin.getDword("flags", vf_default); wchar_t buffer[64] = { 0 }; int i; @@ -68,7 +68,7 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam) for (auto &it : checkboxes) mod_flags |= IsDlgButtonChecked(hdlg, it.idc) ? it.flag : 0; - db_set_dw(NULL, MODULENAME, "flags", mod_flags); + g_plugin.setDword("flags", mod_flags); return 1; } break; -- cgit v1.2.3