diff options
| author | George Hazan <ghazan@miranda.im> | 2018-11-13 23:17:16 +0300 |
|---|---|---|
| committer | George Hazan <ghazan@miranda.im> | 2018-11-13 23:17:16 +0300 |
| commit | 37bf075d4d326f6d5577fd2ce81f0e75d5ee7311 (patch) | |
| tree | 1b2f1fbf833ec7ee005e8f430622a5ed2b564c79 /plugins/YAMN/src/proto | |
| parent | 70ac0a879897a5100308f70d667267e5962060d4 (diff) | |
YAMN -> g_plugin
Diffstat (limited to 'plugins/YAMN/src/proto')
| -rw-r--r-- | plugins/YAMN/src/proto/pop3/pop3comm.cpp | 19 | ||||
| -rw-r--r-- | plugins/YAMN/src/proto/pop3/pop3opt.cpp | 18 |
2 files changed, 18 insertions, 19 deletions
diff --git a/plugins/YAMN/src/proto/pop3/pop3comm.cpp b/plugins/YAMN/src/proto/pop3/pop3comm.cpp index f601ab947f..656dc1e5c1 100644 --- a/plugins/YAMN/src/proto/pop3/pop3comm.cpp +++ b/plugins/YAMN/src/proto/pop3/pop3comm.cpp @@ -283,10 +283,10 @@ int RegisterPOP3Plugin(WPARAM, LPARAM) for (Finder = POP3Plugin->FirstAccount; Finder != nullptr; Finder = Finder->Next) {
Finder->hContact = NULL;
for (auto &hContact : Contacts(YAMN_DBMODULE)) {
- if (!db_get_s(hContact, YAMN_DBMODULE, "Id", &dbv)) {
+ if (!g_plugin.getString(hContact, "Id", &dbv)) {
if (mir_strcmp(dbv.pszVal, Finder->Name) == 0) {
Finder->hContact = hContact;
- db_set_w(Finder->hContact, YAMN_DBMODULE, "Status", ID_STATUS_ONLINE);
+ g_plugin.setWord(Finder->hContact, "Status", ID_STATUS_ONLINE);
db_set_s(Finder->hContact, "CList", "StatusMsg", Translate("No new mail message"));
if ((Finder->Flags & YAMN_ACC_ENA) && (Finder->NewMailN.Flags & YAMN_ACC_CONT))
db_unset(Finder->hContact, "CList", "Hidden");
@@ -302,10 +302,9 @@ int RegisterPOP3Plugin(WPARAM, LPARAM) // No account contact found, have to create one
Finder->hContact = db_add_contact();
Proto_AddToContact(Finder->hContact, YAMN_DBMODULE);
- db_set_s(Finder->hContact, YAMN_DBMODULE, "Id", Finder->Name);
- db_set_s(Finder->hContact, YAMN_DBMODULE, "Nick", Finder->Name);
- db_set_s(Finder->hContact, "Protocol", "p", YAMN_DBMODULE);
- db_set_w(Finder->hContact, YAMN_DBMODULE, "Status", YAMN_STATUS);
+ g_plugin.setString(Finder->hContact, "Id", Finder->Name);
+ g_plugin.setString(Finder->hContact, "Nick", Finder->Name);
+ g_plugin.setWord(Finder->hContact, "Status", YAMN_STATUS);
}
}
@@ -406,10 +405,10 @@ HYAMNMAIL WINAPI CreatePOP3Mail(HACCOUNT Account, DWORD) return (HYAMNMAIL)NewMail;
}
-static void SetContactStatus(HACCOUNT account, int status) {
- if ((account->hContact) && (account->NewMailN.Flags & YAMN_ACC_CONT)) {
- db_set_w(account->hContact, YAMN_DBMODULE, "Status", status);
- }
+static void SetContactStatus(HACCOUNT account, int status)
+{
+ if ((account->hContact) && (account->NewMailN.Flags & YAMN_ACC_CONT))
+ g_plugin.setWord(account->hContact, "Status", status);
}
static void PostErrorProc(HPOP3ACCOUNT ActualAccount, void *ParamToBadConnection, DWORD POP3PluginParam, BOOL UseSSL)
diff --git a/plugins/YAMN/src/proto/pop3/pop3opt.cpp b/plugins/YAMN/src/proto/pop3/pop3opt.cpp index ff4b4f33d6..bd4e2c4220 100644 --- a/plugins/YAMN/src/proto/pop3/pop3opt.cpp +++ b/plugins/YAMN/src/proto/pop3/pop3opt.cpp @@ -20,13 +20,13 @@ INT_PTR CALLBACK DlgProcYAMNOpt(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lPara switch (msg) {
case WM_INITDIALOG:
TranslateDialogDefault(hDlg);
- CheckDlgButton(hDlg, IDC_CHECKTTB, db_get_b(0, YAMN_DBMODULE, YAMN_TTBFCHECK, 1) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CHECKTTB, g_plugin.getByte(YAMN_TTBFCHECK, 1) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hDlg, IDC_LONGDATE, (optDateTime&SHOWDATELONG) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hDlg, IDC_SMARTDATE, (optDateTime&SHOWDATENOTODAY) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hDlg, IDC_NOSECONDS, (optDateTime&SHOWDATENOSECONDS) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg, IDC_MAINMENU, db_get_b(0, YAMN_DBMODULE, YAMN_SHOWMAINMENU, 1) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg, IDC_YAMNASPROTO, db_get_b(0, YAMN_DBMODULE, YAMN_SHOWASPROTO, 1) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hDlg, IDC_CLOSEONDELETE, db_get_b(0, YAMN_DBMODULE, YAMN_CLOSEDELETE, 0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_MAINMENU, g_plugin.getByte(YAMN_SHOWMAINMENU, 1) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_YAMNASPROTO, g_plugin.getByte(YAMN_SHOWASPROTO, 1) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hDlg, IDC_CLOSEONDELETE, g_plugin.getByte(YAMN_CLOSEDELETE, 0) ? BST_CHECKED : BST_UNCHECKED);
break;
case WM_COMMAND:
@@ -48,10 +48,10 @@ INT_PTR CALLBACK DlgProcYAMNOpt(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lPara case 0:
switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
- db_set_b(0, YAMN_DBMODULE, YAMN_SHOWASPROTO, IsDlgButtonChecked(hDlg, IDC_YAMNASPROTO));
- db_set_b(0, YAMN_DBMODULE, YAMN_SHOWMAINMENU, IsDlgButtonChecked(hDlg, IDC_MAINMENU));
- db_set_b(0, YAMN_DBMODULE, YAMN_CLOSEDELETE, IsDlgButtonChecked(hDlg, IDC_CLOSEONDELETE));
- db_set_b(0, YAMN_DBMODULE, YAMN_TTBFCHECK, IsDlgButtonChecked(hDlg, IDC_CHECKTTB));
+ g_plugin.setByte(YAMN_SHOWASPROTO, IsDlgButtonChecked(hDlg, IDC_YAMNASPROTO));
+ g_plugin.setByte(YAMN_SHOWMAINMENU, IsDlgButtonChecked(hDlg, IDC_MAINMENU));
+ g_plugin.setByte(YAMN_CLOSEDELETE, IsDlgButtonChecked(hDlg, IDC_CLOSEONDELETE));
+ g_plugin.setByte(YAMN_TTBFCHECK, IsDlgButtonChecked(hDlg, IDC_CHECKTTB));
AddTopToolbarIcon(0, 0);
CheckMenuItems();
@@ -60,7 +60,7 @@ INT_PTR CALLBACK DlgProcYAMNOpt(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lPara if (IsDlgButtonChecked(hDlg, IDC_LONGDATE))optDateTime |= SHOWDATELONG;
if (IsDlgButtonChecked(hDlg, IDC_SMARTDATE))optDateTime |= SHOWDATENOTODAY;
if (IsDlgButtonChecked(hDlg, IDC_NOSECONDS))optDateTime |= SHOWDATENOSECONDS;
- db_set_b(0, YAMN_DBMODULE, YAMN_DBTIMEOPTIONS, optDateTime);
+ g_plugin.setByte(YAMN_DBTIMEOPTIONS, optDateTime);
}
}
break;
|
