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/AvatarHistory | |
parent | 488214ac8af0c4aeb1a5c1d8fd48368daaf4c4c7 (diff) |
db_* functions replaced with g_plugin calls
Diffstat (limited to 'plugins/AvatarHistory')
-rw-r--r-- | plugins/AvatarHistory/src/AvatarDlg.cpp | 4 | ||||
-rw-r--r-- | plugins/AvatarHistory/src/AvatarHistory.cpp | 22 | ||||
-rw-r--r-- | plugins/AvatarHistory/src/options.cpp | 6 | ||||
-rw-r--r-- | plugins/AvatarHistory/src/popup.cpp | 2 | ||||
-rw-r--r-- | plugins/AvatarHistory/src/utils.cpp | 2 |
5 files changed, 18 insertions, 18 deletions
diff --git a/plugins/AvatarHistory/src/AvatarDlg.cpp b/plugins/AvatarHistory/src/AvatarDlg.cpp index 3cd569c8ce..664f1892b8 100644 --- a/plugins/AvatarHistory/src/AvatarDlg.cpp +++ b/plugins/AvatarHistory/src/AvatarDlg.cpp @@ -116,7 +116,7 @@ static INT_PTR CALLBACK AvatarDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARA AvatarDialogData *data = (struct AvatarDialogData*) lParam;
SendMessage(hwnd, WM_SETICON, ICON_BIG, (LPARAM)createDefaultOverlayedIcon(TRUE));
SendMessage(hwnd, WM_SETICON, ICON_SMALL, (LPARAM)createDefaultOverlayedIcon(FALSE));
- if (db_get_b(NULL, MODULENAME, "LogToHistory", AVH_DEF_LOGTOHISTORY))
+ if (g_plugin.getByte("LogToHistory", AVH_DEF_LOGTOHISTORY))
FillAvatarListFromDB(hwndList, data->hContact);
else if (opts.log_store_as_hash)
FillAvatarListFromFolder(hwndList, data->hContact);
@@ -310,7 +310,7 @@ static INT_PTR CALLBACK AvatarDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARA wchar_t avfolder[MAX_PATH];
MCONTACT hContact = (MCONTACT)GetWindowLongPtr(hwnd, GWLP_USERDATA);
GetContactFolder(avfolder, hContact);
- ShellExecute(nullptr, db_get_b(NULL, MODULENAME, "OpenFolderMethod", 0) ? L"explore" : L"open", avfolder, nullptr, nullptr, SW_SHOWNORMAL);
+ ShellExecute(nullptr, g_plugin.getByte("OpenFolderMethod", 0) ? L"explore" : L"open", avfolder, nullptr, nullptr, SW_SHOWNORMAL);
return TRUE;
}
break;
diff --git a/plugins/AvatarHistory/src/AvatarHistory.cpp b/plugins/AvatarHistory/src/AvatarHistory.cpp index d15b8062bb..7ed09f7e59 100644 --- a/plugins/AvatarHistory/src/AvatarHistory.cpp +++ b/plugins/AvatarHistory/src/AvatarHistory.cpp @@ -283,7 +283,7 @@ int CMPlugin::Load() CoInitialize(nullptr);
// Is first run?
- if (db_get_b(NULL, MODULENAME, "FirstRun", 1)) {
+ if (g_plugin.getByte("FirstRun", 1)) {
// Show dialog
int ret = DialogBoxParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_FIRST_RUN), nullptr, FirstRunDlgProc, 0);
if (ret == 0)
@@ -291,29 +291,29 @@ int CMPlugin::Load() // Write settings
- db_set_b(NULL, MODULENAME, "LogToDisk", 1);
+ g_plugin.setByte("LogToDisk", 1);
if (ret == IDC_MIR_SAME)
- db_set_b(NULL, MODULENAME, "LogKeepSameFolder", 1);
+ g_plugin.setByte("LogKeepSameFolder", 1);
else
- db_set_b(NULL, MODULENAME, "LogKeepSameFolder", 0);
+ g_plugin.setByte("LogKeepSameFolder", 0);
if (ret == IDC_MIR_SHORT || ret == IDC_SHORT || ret == IDC_DUP)
- db_set_b(NULL, MODULENAME, "LogPerContactFolders", 1);
+ g_plugin.setByte("LogPerContactFolders", 1);
else
- db_set_b(NULL, MODULENAME, "LogPerContactFolders", 0);
+ g_plugin.setByte("LogPerContactFolders", 0);
if (ret == IDC_DUP)
- db_set_b(NULL, MODULENAME, "StoreAsHash", 0);
+ g_plugin.setByte("StoreAsHash", 0);
else
- db_set_b(NULL, MODULENAME, "StoreAsHash", 1);
+ g_plugin.setByte("StoreAsHash", 1);
if (ret == IDC_MIR_SAME || ret == IDC_MIR_PROTO || ret == IDC_MIR_SHORT)
- db_set_b(NULL, MODULENAME, "LogToHistory", 1);
+ g_plugin.setByte("LogToHistory", 1);
else
- db_set_b(NULL, MODULENAME, "LogToHistory", 0);
+ g_plugin.setByte("LogToHistory", 0);
- db_set_b(NULL, MODULENAME, "FirstRun", 0);
+ g_plugin.setByte("FirstRun", 0);
}
LoadOptions();
diff --git a/plugins/AvatarHistory/src/options.cpp b/plugins/AvatarHistory/src/options.cpp index 3ea17f3fff..900bdf1c7a 100644 --- a/plugins/AvatarHistory/src/options.cpp +++ b/plugins/AvatarHistory/src/options.cpp @@ -170,7 +170,7 @@ void LoadOptions() LoadOpts(optionsControls, _countof(optionsControls), MODULENAME);
LoadOpts(popupsControls, _countof(popupsControls), MODULENAME);
- opts.log_per_contact_folders = db_get_b(NULL, MODULENAME, "LogPerContactFolders", 0);
- opts.log_keep_same_folder = db_get_b(NULL, MODULENAME, "LogKeepSameFolder", 0);
- opts.log_store_as_hash = db_get_b(NULL, MODULENAME, "StoreAsHash", 1);
+ opts.log_per_contact_folders = g_plugin.getByte("LogPerContactFolders", 0);
+ opts.log_keep_same_folder = g_plugin.getByte("LogKeepSameFolder", 0);
+ opts.log_store_as_hash = g_plugin.getByte("StoreAsHash", 1);
}
diff --git a/plugins/AvatarHistory/src/popup.cpp b/plugins/AvatarHistory/src/popup.cpp index ead52b114d..fad9b3c33a 100644 --- a/plugins/AvatarHistory/src/popup.cpp +++ b/plugins/AvatarHistory/src/popup.cpp @@ -74,7 +74,7 @@ void ShowPopup(MCONTACT hContact, const wchar_t *title, const wchar_t *descripti void ShowDebugPopup(MCONTACT hContact, const wchar_t *title, const wchar_t *description)
{
- if (db_get_b(NULL, MODULENAME, "Debug", 0)) {
+ if (g_plugin.getByte("Debug", 0)) {
ShowPopup(hContact, title, description);
}
}
diff --git a/plugins/AvatarHistory/src/utils.cpp b/plugins/AvatarHistory/src/utils.cpp index 9b70f7f762..a3af7ab9bd 100644 --- a/plugins/AvatarHistory/src/utils.cpp +++ b/plugins/AvatarHistory/src/utils.cpp @@ -38,7 +38,7 @@ bool ContactEnabled(MCONTACT hContact, char *setting, int def) if (!ProtocolEnabled(proto))
return false;
- BYTE globpref = db_get_b(NULL, MODULENAME, setting, def);
+ BYTE globpref = g_plugin.getByte(setting, def);
BYTE userpref = db_get_b(hContact, MODULENAME, setting, BST_INDETERMINATE);
return (globpref && userpref == BST_INDETERMINATE) || userpref == BST_CHECKED;
|