diff options
author | George Hazan <ghazan@miranda.im> | 2018-11-12 21:44:56 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-11-12 21:44:56 +0300 |
commit | 53fe3e46177d17b4941610de19f5cc6210700cb4 (patch) | |
tree | b67a6bc208dad141f9db14035cd7e42ff2a51872 /plugins/IEHistory | |
parent | 488214ac8af0c4aeb1a5c1d8fd48368daaf4c4c7 (diff) |
db_* functions replaced with g_plugin calls
Diffstat (limited to 'plugins/IEHistory')
-rw-r--r-- | plugins/IEHistory/src/dlgHandlers.cpp | 24 | ||||
-rw-r--r-- | plugins/IEHistory/src/services.cpp | 4 |
2 files changed, 14 insertions, 14 deletions
diff --git a/plugins/IEHistory/src/dlgHandlers.cpp b/plugins/IEHistory/src/dlgHandlers.cpp index 6e5b146434..5f75aaac66 100644 --- a/plugins/IEHistory/src/dlgHandlers.cpp +++ b/plugins/IEHistory/src/dlgHandlers.cpp @@ -241,8 +241,8 @@ int LoadEvents(HWND hWnd) {
HistoryWindowData *data = (HistoryWindowData *)GetWindowLongPtr(hWnd, DWLP_USER);
int count = db_event_count(data->contact);
- int bLastFirst = db_get_b(NULL, MODULENAME, "ShowLastPageFirst", 0);
- int bRTL = db_get_b(NULL, MODULENAME, "EnableRTL", 0);
+ int bLastFirst = g_plugin.getByte("ShowLastPageFirst", 0);
+ int bRTL = g_plugin.getByte("EnableRTL", 0);
bRTL = db_get_b(data->contact, "Tab_SRMsg", "RTL", bRTL);
data->bEnableRTL = bRTL;
data->count = count;
@@ -362,7 +362,7 @@ INT_PTR CALLBACK HistoryDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPara TranslateDialogDefault(hWnd);
SendMessage(hWnd, WM_SETICON, ICON_BIG, (LPARAM)hIcon);
{
- int bRTL = db_get_b(NULL, MODULENAME, "EnableRTL", 0);
+ int bRTL = g_plugin.getByte("EnableRTL", 0);
if (bRTL)
SetWindowLongPtr(hWnd, GWL_EXSTYLE, WS_EX_RTLREADING);
@@ -392,7 +392,7 @@ INT_PTR CALLBACK HistoryDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPara LoadEvents(hWnd);
{
bool bAll = (data->itemsPerPage <= 0) || (data->itemsPerPage >= data->count);
- int bLastFirst = db_get_b(NULL, MODULENAME, "ShowLastPageFirst", 0);
+ int bLastFirst = g_plugin.getByte("ShowLastPageFirst", 0);
if (!bLastFirst) {
EnableWindow(GetDlgItem(hWnd, IDC_PREV), FALSE);
EnableWindow(GetDlgItem(hWnd, IDC_NEXT), !bAll);
@@ -611,15 +611,15 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARA case WM_INITDIALOG:
TranslateDialogDefault(hWnd);
{
- int count = db_get_dw(NULL, MODULENAME, "EventsToLoad", 0);
+ int count = g_plugin.getDword("EventsToLoad", 0);
EnableWindow(GetDlgItem(hWnd, IDC_EVENTS_COUNT), count > 0);
EnableWindow(GetDlgItem(hWnd, IDC_SHOW_LAST_FIRST), count > 0);
CheckDlgButton(hWnd, IDC_LOAD_ALL, count <= 0 ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hWnd, IDC_LOAD_NUMBER, count > 0 ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hWnd, IDC_ENABLE_RTL, db_get_b(NULL, MODULENAME, "EnableRTL", 0) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hWnd, IDC_SHOW_LAST_FIRST, db_get_b(NULL, MODULENAME, "ShowLastPageFirst", 0) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hWnd, IDC_LOAD_BACKGROUND, db_get_b(NULL, MODULENAME, "UseWorkerThread", 0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hWnd, IDC_ENABLE_RTL, g_plugin.getByte("EnableRTL", 0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hWnd, IDC_SHOW_LAST_FIRST, g_plugin.getByte("ShowLastPageFirst", 0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hWnd, IDC_LOAD_BACKGROUND, g_plugin.getByte("UseWorkerThread", 0) ? BST_CHECKED : BST_UNCHECKED);
wchar_t buffer[40];
_itow_s(count, buffer, 10);
@@ -664,10 +664,10 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARA count = _wtol(buffer);
count = (count < 0) ? 0 : count;
}
- db_set_b(NULL, MODULENAME, "ShowLastPageFirst", IsDlgButtonChecked(hWnd, IDC_SHOW_LAST_FIRST));
- db_set_b(NULL, MODULENAME, "EnableRTL", IsDlgButtonChecked(hWnd, IDC_ENABLE_RTL));
- db_set_b(NULL, MODULENAME, "UseWorkerThread", IsDlgButtonChecked(hWnd, IDC_LOAD_BACKGROUND));
- db_set_dw(NULL, MODULENAME, "EventsToLoad", count);
+ g_plugin.setByte("ShowLastPageFirst", IsDlgButtonChecked(hWnd, IDC_SHOW_LAST_FIRST));
+ g_plugin.setByte("EnableRTL", IsDlgButtonChecked(hWnd, IDC_ENABLE_RTL));
+ g_plugin.setByte("UseWorkerThread", IsDlgButtonChecked(hWnd, IDC_LOAD_BACKGROUND));
+ g_plugin.setDword("EventsToLoad", count);
}
}
break;
diff --git a/plugins/IEHistory/src/services.cpp b/plugins/IEHistory/src/services.cpp index 464072b8e3..ec5210e8df 100644 --- a/plugins/IEHistory/src/services.cpp +++ b/plugins/IEHistory/src/services.cpp @@ -34,8 +34,8 @@ INT_PTR ShowContactHistoryService(WPARAM wParam, LPARAM) HWND parent = nullptr; historyDlg = WindowList_Find(hOpenWindowsList, (MCONTACT)wParam); if (historyDlg == nullptr){ - int count = db_get_dw(NULL, MODULENAME, "EventsToLoad", 0); - int loadInBackground = db_get_b(NULL, MODULENAME, "UseWorkerThread", 0); + int count = g_plugin.getDword("EventsToLoad", 0); + int loadInBackground = g_plugin.getByte("UseWorkerThread", 0); HistoryWindowData *data; data = (HistoryWindowData *)malloc(sizeof(HistoryWindowData)); data->contact = (MCONTACT)wParam; |