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/WhoUsesMyFiles/src | |
parent | 488214ac8af0c4aeb1a5c1d8fd48368daaf4c4c7 (diff) |
db_* functions replaced with g_plugin calls
Diffstat (limited to 'plugins/WhoUsesMyFiles/src')
-rw-r--r-- | plugins/WhoUsesMyFiles/src/options.cpp | 34 | ||||
-rw-r--r-- | plugins/WhoUsesMyFiles/src/wumfplug.cpp | 38 |
2 files changed, 36 insertions, 36 deletions
diff --git a/plugins/WhoUsesMyFiles/src/options.cpp b/plugins/WhoUsesMyFiles/src/options.cpp index a552d7cb6e..60f1e941d0 100644 --- a/plugins/WhoUsesMyFiles/src/options.cpp +++ b/plugins/WhoUsesMyFiles/src/options.cpp @@ -241,24 +241,24 @@ INT_PTR CALLBACK OptionsDlgProc(HWND hwndDlg,UINT msg,WPARAM wparam,LPARAM lpara return TRUE; case PSN_APPLY: - db_set_dw(NULL, MODULENAME, COLOR_TEXT, (DWORD)WumfOptions.ColorText); - db_set_dw(NULL, MODULENAME, COLOR_BACK, (DWORD)WumfOptions.ColorBack); - db_set_b(NULL, MODULENAME, COLOR_DEF, (BYTE)WumfOptions.UseDefColor); - db_set_b(NULL, MODULENAME, COLOR_WIN, (BYTE)WumfOptions.UseWinColor); - db_set_b(NULL, MODULENAME, COLOR_SET, (BYTE)WumfOptions.SelectColor ); - db_set_b(NULL, MODULENAME, DELAY_DEF, (BYTE)WumfOptions.DelayDef); - db_set_b(NULL, MODULENAME, DELAY_INF, (BYTE)WumfOptions.DelayInf); - db_set_b(NULL, MODULENAME, DELAY_SET, (BYTE)WumfOptions.DelaySet); - db_set_b(NULL, MODULENAME, DELAY_SEC, (BYTE)WumfOptions.DelaySec); - db_set_b(NULL, MODULENAME, LOG_INTO_FILE, (BYTE)WumfOptions.LogToFile); - db_set_b(NULL, MODULENAME, LOG_FOLDER, (BYTE)WumfOptions.LogFolders); - db_set_b(NULL, MODULENAME, ALERT_FOLDER, (BYTE)WumfOptions.AlertFolders); - db_set_b(NULL, MODULENAME, LOG_UNC, (BYTE)WumfOptions.LogUNC); - db_set_b(NULL, MODULENAME, ALERT_UNC, (BYTE)WumfOptions.AlertUNC); - db_set_b(NULL, MODULENAME, LOG_COMP, (BYTE)WumfOptions.LogComp); - db_set_b(NULL, MODULENAME, ALERT_COMP, (BYTE)WumfOptions.AlertComp); + g_plugin.setDword(COLOR_TEXT, (DWORD)WumfOptions.ColorText); + g_plugin.setDword(COLOR_BACK, (DWORD)WumfOptions.ColorBack); + g_plugin.setByte(COLOR_DEF, (BYTE)WumfOptions.UseDefColor); + g_plugin.setByte(COLOR_WIN, (BYTE)WumfOptions.UseWinColor); + g_plugin.setByte(COLOR_SET, (BYTE)WumfOptions.SelectColor ); + g_plugin.setByte(DELAY_DEF, (BYTE)WumfOptions.DelayDef); + g_plugin.setByte(DELAY_INF, (BYTE)WumfOptions.DelayInf); + g_plugin.setByte(DELAY_SET, (BYTE)WumfOptions.DelaySet); + g_plugin.setByte(DELAY_SEC, (BYTE)WumfOptions.DelaySec); + g_plugin.setByte(LOG_INTO_FILE, (BYTE)WumfOptions.LogToFile); + g_plugin.setByte(LOG_FOLDER, (BYTE)WumfOptions.LogFolders); + g_plugin.setByte(ALERT_FOLDER, (BYTE)WumfOptions.AlertFolders); + g_plugin.setByte(LOG_UNC, (BYTE)WumfOptions.LogUNC); + g_plugin.setByte(ALERT_UNC, (BYTE)WumfOptions.AlertUNC); + g_plugin.setByte(LOG_COMP, (BYTE)WumfOptions.LogComp); + g_plugin.setByte(ALERT_COMP, (BYTE)WumfOptions.AlertComp); GetDlgItemText(hwndDlg, IDC_FILE, WumfOptions.LogFile, _countof(WumfOptions.LogFile)); - db_set_ws(NULL, MODULENAME, OPT_FILE, WumfOptions.LogFile); + g_plugin.setWString(OPT_FILE, WumfOptions.LogFile); } } break; diff --git a/plugins/WhoUsesMyFiles/src/wumfplug.cpp b/plugins/WhoUsesMyFiles/src/wumfplug.cpp index e2876ae1c7..26ff252798 100644 --- a/plugins/WhoUsesMyFiles/src/wumfplug.cpp +++ b/plugins/WhoUsesMyFiles/src/wumfplug.cpp @@ -35,38 +35,38 @@ void LoadOptions() DBVARIANT dbv = { 0 };
dbv.type = DBVT_WCHAR;
memset(&WumfOptions, 0, sizeof(WumfOptions));
- if (db_get_ws(NULL, MODULENAME, OPT_FILE, &dbv) == 0) {
+ if (g_plugin.getWString(OPT_FILE, &dbv) == 0) {
wcsncpy(WumfOptions.LogFile, dbv.pwszVal, 255);
db_free(&dbv);
}
else
WumfOptions.LogFile[0] = '\0';
- WumfOptions.PopupsEnabled = db_get_b(NULL, MODULENAME, POPUPS_ENABLED, TRUE);
+ WumfOptions.PopupsEnabled = g_plugin.getByte(POPUPS_ENABLED, TRUE);
- WumfOptions.UseDefColor = db_get_b(NULL, MODULENAME, COLOR_DEF, TRUE);
- WumfOptions.UseWinColor = db_get_b(NULL, MODULENAME, COLOR_WIN, FALSE);
- WumfOptions.SelectColor = db_get_b(NULL, MODULENAME, COLOR_SET, FALSE);
+ WumfOptions.UseDefColor = g_plugin.getByte(COLOR_DEF, TRUE);
+ WumfOptions.UseWinColor = g_plugin.getByte(COLOR_WIN, FALSE);
+ WumfOptions.SelectColor = g_plugin.getByte(COLOR_SET, FALSE);
- WumfOptions.ColorText = db_get_dw(NULL, MODULENAME, COLOR_TEXT, RGB(0, 0, 0));
- WumfOptions.ColorBack = db_get_dw(NULL, MODULENAME, COLOR_BACK, RGB(255, 255, 255));
+ WumfOptions.ColorText = g_plugin.getDword(COLOR_TEXT, RGB(0, 0, 0));
+ WumfOptions.ColorBack = g_plugin.getDword(COLOR_BACK, RGB(255, 255, 255));
- WumfOptions.DelayDef = db_get_b(NULL, MODULENAME, DELAY_DEF, TRUE);
- WumfOptions.DelayInf = db_get_b(NULL, MODULENAME, DELAY_INF, FALSE);
- WumfOptions.DelaySet = db_get_b(NULL, MODULENAME, DELAY_SET, FALSE);
- WumfOptions.DelaySec = db_get_b(NULL, MODULENAME, DELAY_SEC, 0);
+ WumfOptions.DelayDef = g_plugin.getByte(DELAY_DEF, TRUE);
+ WumfOptions.DelayInf = g_plugin.getByte(DELAY_INF, FALSE);
+ WumfOptions.DelaySet = g_plugin.getByte(DELAY_SET, FALSE);
+ WumfOptions.DelaySec = g_plugin.getByte(DELAY_SEC, 0);
if (!ServiceExists(MS_POPUP_ADDPOPUPT)) {
WumfOptions.DelayDef = TRUE;
WumfOptions.DelaySet = FALSE;
WumfOptions.DelayInf = FALSE;
}
- WumfOptions.LogToFile = db_get_b(NULL, MODULENAME, LOG_INTO_FILE, FALSE);
- WumfOptions.LogFolders = db_get_b(NULL, MODULENAME, LOG_FOLDER, TRUE);
- WumfOptions.AlertFolders = db_get_b(NULL, MODULENAME, ALERT_FOLDER, TRUE);
- WumfOptions.LogUNC = db_get_b(NULL, MODULENAME, LOG_UNC, FALSE);
- WumfOptions.AlertUNC = db_get_b(NULL, MODULENAME, ALERT_UNC, FALSE);
- WumfOptions.LogComp = db_get_b(NULL, MODULENAME, LOG_COMP, FALSE);
- WumfOptions.AlertComp = db_get_b(NULL, MODULENAME, ALERT_COMP, FALSE);
+ WumfOptions.LogToFile = g_plugin.getByte(LOG_INTO_FILE, FALSE);
+ WumfOptions.LogFolders = g_plugin.getByte(LOG_FOLDER, TRUE);
+ WumfOptions.AlertFolders = g_plugin.getByte(ALERT_FOLDER, TRUE);
+ WumfOptions.LogUNC = g_plugin.getByte(LOG_UNC, FALSE);
+ WumfOptions.AlertUNC = g_plugin.getByte(ALERT_UNC, FALSE);
+ WumfOptions.LogComp = g_plugin.getByte(LOG_COMP, FALSE);
+ WumfOptions.AlertComp = g_plugin.getByte(ALERT_COMP, FALSE);
}
void ExecuteMenu(HWND hWnd)
@@ -199,7 +199,7 @@ static INT_PTR WumfMenuCommand(WPARAM, LPARAM) Menu_ModifyItem(hMenuItem, LPGENW("Disable WUMF popups"), LoadIcon(g_plugin.getInst(), MAKEINTRESOURCE(IDI_POPUP)));
}
- db_set_b(NULL, MODULENAME, POPUPS_ENABLED, (BYTE)WumfOptions.PopupsEnabled);
+ g_plugin.setByte(POPUPS_ENABLED, (BYTE)WumfOptions.PopupsEnabled);
return 0;
}
|