summaryrefslogtreecommitdiff
path: root/plugins/New_GPG
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2016-07-29 12:36:34 +0000
committerGeorge Hazan <george.hazan@gmail.com>2016-07-29 12:36:34 +0000
commit428bf0cbd77813a43094cb5c984436deff251936 (patch)
treed7dfa8971153d53a849e45c942be97fe5b90b7ec /plugins/New_GPG
parent82ef17ca5286f58ae7af604fb9518e8dc496b7c3 (diff)
no more TCHARs
git-svn-id: http://svn.miranda-ng.org/main/trunk@17143 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/New_GPG')
-rw-r--r--plugins/New_GPG/src/init.cpp2
-rwxr-xr-xplugins/New_GPG/src/main.cpp40
-rwxr-xr-xplugins/New_GPG/src/messages.cpp6
-rwxr-xr-xplugins/New_GPG/src/options.cpp26
-rwxr-xr-xplugins/New_GPG/src/utilities.cpp10
5 files changed, 42 insertions, 42 deletions
diff --git a/plugins/New_GPG/src/init.cpp b/plugins/New_GPG/src/init.cpp
index a2dee64295..e62d46c7f5 100644
--- a/plugins/New_GPG/src/init.cpp
+++ b/plugins/New_GPG/src/init.cpp
@@ -184,7 +184,7 @@ extern "C" int __declspec(dllexport) Load()
SET_UID(mi, 0xbd22e3f8, 0xc19c, 0x45a8, 0xb7, 0x37, 0x6b, 0x3b, 0x27, 0xf0, 0x8c, 0xbb);
mi.position = -0x7FFFFFFF;
- mi.flags = CMIF_TCHAR;
+ mi.flags = CMIF_UNICODE;
mi.hIcolibItem = Skin_LoadIcon(SKINICON_OTHER_MIRANDA);
mi.name.w = LPGENW("Load GPG public key");
mi.pszService = "/LoadPubKey";
diff --git a/plugins/New_GPG/src/main.cpp b/plugins/New_GPG/src/main.cpp
index bc7c4764ac..a28f21294c 100755
--- a/plugins/New_GPG/src/main.cpp
+++ b/plugins/New_GPG/src/main.cpp
@@ -307,8 +307,8 @@ static INT_PTR CALLBACK DlgProcFirstRun(HWND hwndDlg, UINT uMsg, WPARAM wParam,
GetDlgItemTextA(hwndDlg, IDC_ACCOUNT, buf, _countof(buf));
if (!mir_strcmp(buf, Translate("Default"))) {
db_set_s(NULL, szGPGModuleName, "GPGPubKey", out.c_str());
- db_set_ts(NULL, szGPGModuleName, "KeyMainName", name);
- db_set_ts(NULL, szGPGModuleName, "KeyID", fp);
+ db_set_ws(NULL, szGPGModuleName, "KeyMainName", name);
+ db_set_ws(NULL, szGPGModuleName, "KeyID", fp);
}
else {
std::string acc_str = buf;
@@ -316,10 +316,10 @@ static INT_PTR CALLBACK DlgProcFirstRun(HWND hwndDlg, UINT uMsg, WPARAM wParam,
db_set_s(NULL, szGPGModuleName, acc_str.c_str(), out.c_str());
acc_str = buf;
acc_str += "_KeyMainName";
- db_set_ts(NULL, szGPGModuleName, acc_str.c_str(), name);
+ db_set_ws(NULL, szGPGModuleName, acc_str.c_str(), name);
acc_str = buf;
acc_str += "_KeyID";
- db_set_ts(NULL, szGPGModuleName, acc_str.c_str(), fp);
+ db_set_ws(NULL, szGPGModuleName, acc_str.c_str(), fp);
}
if (!mir_strcmp(buf, Translate("Default"))) {
wstring keyinfo = TranslateT("Default private key ID");
@@ -337,7 +337,7 @@ static INT_PTR CALLBACK DlgProcFirstRun(HWND hwndDlg, UINT uMsg, WPARAM wParam,
dbsetting += keyid;
mir_free(keyid);
dbsetting += "_Password";
- db_set_ts(NULL, szGPGModuleName, dbsetting.c_str(), passwd);
+ db_set_ws(NULL, szGPGModuleName, dbsetting.c_str(), passwd);
}
delete[] name;
}
@@ -592,7 +592,7 @@ static INT_PTR CALLBACK DlgProcFirstRun(HWND hwndDlg, UINT uMsg, WPARAM wParam,
GetDlgItemTextA(hwndDlg, IDC_ACCOUNT, buf, _countof(buf));
if (!mir_strcmp(buf, Translate("Default"))) {
db_set_s(NULL, szGPGModuleName, "GPGPubKey", out.c_str());
- db_set_ts(NULL, szGPGModuleName, "KeyID", fp);
+ db_set_ws(NULL, szGPGModuleName, "KeyID", fp);
}
else {
std::string acc_str = buf;
@@ -600,7 +600,7 @@ static INT_PTR CALLBACK DlgProcFirstRun(HWND hwndDlg, UINT uMsg, WPARAM wParam,
db_set_s(NULL, szGPGModuleName, acc_str.c_str(), out.c_str());
acc_str = buf;
acc_str += "_KeyID";
- db_set_ts(NULL, szGPGModuleName, acc_str.c_str(), fp);
+ db_set_ws(NULL, szGPGModuleName, acc_str.c_str(), fp);
}
}
extern HWND hwndCurKey_p;
@@ -825,7 +825,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
SetDlgItemText(hwndDlg, IDC_BIN_PATH, tmp);
if (gpg_exists/* && lang_exists*/) {
- db_set_ts(NULL, szGPGModuleName, "szGpgBinPath", tmp);
+ db_set_ws(NULL, szGPGModuleName, "szGpgBinPath", tmp);
string out;
DWORD code;
std::vector<wstring> cmd;
@@ -938,7 +938,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
}
{
bool bad_version = false;
- db_set_ts(NULL, szGPGModuleName, "szGpgBinPath", tmp);
+ db_set_ws(NULL, szGPGModuleName, "szGpgBinPath", tmp);
string out;
DWORD code;
std::vector<wstring> cmd;
@@ -965,7 +965,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
if (bad_version)
MessageBox(0, TranslateT("Unsupported GnuPG version found, use at you own risk!\nIt is recommended that you use GnuPG v1.x.x with this plugin."), TranslateT("Warning"), MB_OK);
}
- db_set_ts(NULL, szGPGModuleName, "szGpgBinPath", tmp);
+ db_set_ws(NULL, szGPGModuleName, "szGpgBinPath", tmp);
GetDlgItemText(hwndDlg, IDC_HOME_DIR, tmp, _countof(tmp));
while (tmp[mir_wstrlen(tmp) - 1] == '\\')
tmp[mir_wstrlen(tmp) - 1] = '\0';
@@ -973,7 +973,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
MessageBox(0, TranslateT("Please set keyring's home directory"), TranslateT("Warning"), MB_OK);
break;
}
- db_set_ts(NULL, szGPGModuleName, "szHomePath", tmp);
+ db_set_ws(NULL, szGPGModuleName, "szHomePath", tmp);
{
wchar_t *path = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L"");
DWORD dwFileAttr = GetFileAttributes(path);
@@ -1009,7 +1009,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
}
{
bool bad_version = false;
- db_set_ts(NULL, szGPGModuleName, "szGpgBinPath", tmp);
+ db_set_ws(NULL, szGPGModuleName, "szGpgBinPath", tmp);
string out;
DWORD code;
std::vector<wstring> cmd;
@@ -1036,7 +1036,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
if (bad_version)
MessageBox(0, TranslateT("Unsupported GnuPG version found, use at you own risk!\nIt is recommended that you use GnuPG v1.x.x with this plugin."), TranslateT("Warning"), MB_OK);
}
- db_set_ts(NULL, szGPGModuleName, "szGpgBinPath", tmp);
+ db_set_ws(NULL, szGPGModuleName, "szGpgBinPath", tmp);
GetDlgItemText(hwndDlg, IDC_HOME_DIR, tmp, _countof(tmp));
while (tmp[mir_wstrlen(tmp) - 1] == '\\')
tmp[mir_wstrlen(tmp) - 1] = '\0';
@@ -1044,7 +1044,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
MessageBox(0, TranslateT("Please set keyring's home directory"), TranslateT("Warning"), MB_OK);
break;
}
- db_set_ts(NULL, szGPGModuleName, "szHomePath", tmp);
+ db_set_ws(NULL, szGPGModuleName, "szHomePath", tmp);
{
wchar_t *path = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L"");
DWORD dwFileAttr = GetFileAttributes(path);
@@ -1139,7 +1139,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
out.erase(s, 1);
}
db_set_s(NULL, szGPGModuleName, "GPGPubKey", out.c_str());
- db_set_ts(NULL, szGPGModuleName, "KeyID", path.c_str());
+ db_set_ws(NULL, szGPGModuleName, "KeyID", path.c_str());
extern HWND hwndCurKey_p;
SetWindowText(hwndCurKey_p, path.c_str());
}
@@ -1876,9 +1876,9 @@ void InitCheck()
{
// parse gpg output
wchar_t *current_home = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L"");
- db_set_ts(NULL, szGPGModuleName, "szHomePath", L""); //we do not need home for gpg binary validation
+ db_set_ws(NULL, szGPGModuleName, "szHomePath", L""); //we do not need home for gpg binary validation
gpg_valid = isGPGValid();
- db_set_ts(NULL, szGPGModuleName, "szHomePath", current_home); //return current home dir back
+ db_set_ws(NULL, szGPGModuleName, "szHomePath", current_home); //return current home dir back
mir_free(current_home);
bool home_dir_access = false, temp_access = false;
wchar_t *home_dir = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", L"");
@@ -2124,12 +2124,12 @@ void ImportKey()
for (int i = 0; i < count; i++) {
MCONTACT hcnt = db_mc_getSub(hContact, i);
if (hcnt)
- db_set_ts(hcnt, szGPGModuleName, "GPGPubKey", new_key.c_str());
+ db_set_ws(hcnt, szGPGModuleName, "GPGPubKey", new_key.c_str());
}
}
- else db_set_ts(metaGetMostOnline(hContact), szGPGModuleName, "GPGPubKey", new_key.c_str());
+ else db_set_ws(metaGetMostOnline(hContact), szGPGModuleName, "GPGPubKey", new_key.c_str());
}
- else db_set_ts(hContact, szGPGModuleName, "GPGPubKey", new_key.c_str());
+ else db_set_ws(hContact, szGPGModuleName, "GPGPubKey", new_key.c_str());
new_key.clear();
diff --git a/plugins/New_GPG/src/messages.cpp b/plugins/New_GPG/src/messages.cpp
index 89e77e782c..dc4f95277b 100755
--- a/plugins/New_GPG/src/messages.cpp
+++ b/plugins/New_GPG/src/messages.cpp
@@ -419,7 +419,7 @@ INT_PTR RecvMsgSvc(WPARAM w, LPARAM l)
if (bDebugLog)
debuglog << std::string(time_str() + ": info(autoexchange): found pubkey block:" + toUTF8(pcli->pfnGetContactDisplayName(ccs->hContact, 0)));
s2 += mir_wstrlen(L"-----END PGP PUBLIC KEY BLOCK-----");
- db_set_ts(ccs->hContact, szGPGModuleName, "GPGPubKey", str.substr(s1, s2 - s1).c_str());
+ db_set_ws(ccs->hContact, szGPGModuleName, "GPGPubKey", str.substr(s1, s2 - s1).c_str());
{ //gpg execute block
std::vector<wstring> cmd;
wchar_t tmp2[MAX_PATH] = { 0 };
@@ -1034,9 +1034,9 @@ static INT_PTR CALLBACK DlgProcKeyPassword(HWND hwndDlg, UINT msg, WPARAM wParam
string dbsetting = "szKey_";
dbsetting += inkeyid;
dbsetting += "_Password";
- db_set_ts(NULL, szGPGModuleName, dbsetting.c_str(), tmp);
+ db_set_ws(NULL, szGPGModuleName, dbsetting.c_str(), tmp);
}
- else db_set_ts(NULL, szGPGModuleName, "szKeyPassword", tmp);
+ else db_set_ws(NULL, szGPGModuleName, "szKeyPassword", tmp);
}
if (password)
mir_free(password);
diff --git a/plugins/New_GPG/src/options.cpp b/plugins/New_GPG/src/options.cpp
index 5a7592f833..4baaa264b1 100755
--- a/plugins/New_GPG/src/options.cpp
+++ b/plugins/New_GPG/src/options.cpp
@@ -46,7 +46,7 @@ int GpgOptInit(WPARAM wParam, LPARAM)
odp.pwszTitle = _T(szGPGModuleName);
odp.pwszGroup = LPGENW("Services");
odp.pwszTab = LPGENW("Main");
- odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
+ odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE;
odp.pfnDlgProc = DlgProcGpgOpts;
Options_AddPage(wParam, &odp);
@@ -399,7 +399,7 @@ static INT_PTR CALLBACK DlgProcGpgOpts(HWND hwndDlg, UINT uMsg, WPARAM wParam, L
{
wchar_t tmp[512];
GetDlgItemText(hwndDlg, IDC_LOG_FILE_EDIT, tmp, _countof(tmp));
- db_set_ts(NULL, szGPGModuleName, "szLogFilePath", tmp);
+ db_set_ws(NULL, szGPGModuleName, "szLogFilePath", tmp);
}
return TRUE;
}
@@ -433,7 +433,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
if (gpg_exists) {
bool bad_version = false;
wchar_t *tmp_path = UniGetContactSettingUtf(NULL, szGPGModuleName, "szGpgBinPath", L"");
- db_set_ts(NULL, szGPGModuleName, "szGpgBinPath", tmp);
+ db_set_ws(NULL, szGPGModuleName, "szGpgBinPath", tmp);
string out;
DWORD code;
std::vector<wstring> cmd;
@@ -447,7 +447,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
gpg_valid = true;
gpg_launcher(params);
gpg_valid = old_gpg_state;
- db_set_ts(NULL, szGPGModuleName, "szGpgBinPath", tmp_path);
+ db_set_ws(NULL, szGPGModuleName, "szGpgBinPath", tmp_path);
mir_free(tmp_path);
string::size_type p1 = out.find("(GnuPG) ");
if (p1 != string::npos) {
@@ -505,11 +505,11 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
case PSN_APPLY:
wchar_t tmp[512];
GetDlgItemText(hwndDlg, IDC_BIN_PATH, tmp, _countof(tmp));
- db_set_ts(NULL, szGPGModuleName, "szGpgBinPath", tmp);
+ db_set_ws(NULL, szGPGModuleName, "szGpgBinPath", tmp);
GetDlgItemText(hwndDlg, IDC_HOME_DIR, tmp, _countof(tmp));
while (tmp[mir_wstrlen(tmp) - 1] == '\\')
tmp[mir_wstrlen(tmp) - 1] = '\0';
- db_set_ts(NULL, szGPGModuleName, "szHomePath", tmp);
+ db_set_ws(NULL, szGPGModuleName, "szHomePath", tmp);
return TRUE;
}
break;
@@ -567,22 +567,22 @@ static INT_PTR CALLBACK DlgProcGpgMsgOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
{
wchar_t tmp[128];
GetDlgItemText(hwndDlg, IDC_IN_OPEN_TAG, tmp, _countof(tmp));
- db_set_ts(NULL, szGPGModuleName, "szInOpenTag", tmp);
+ db_set_ws(NULL, szGPGModuleName, "szInOpenTag", tmp);
mir_free(inopentag);
inopentag = (wchar_t*)mir_alloc(sizeof(wchar_t)* (mir_wstrlen(tmp) + 1));
mir_wstrcpy(inopentag, tmp);
GetDlgItemText(hwndDlg, IDC_IN_CLOSE_TAG, tmp, _countof(tmp));
- db_set_ts(NULL, szGPGModuleName, "szInCloseTag", tmp);
+ db_set_ws(NULL, szGPGModuleName, "szInCloseTag", tmp);
mir_free(inclosetag);
inclosetag = (wchar_t*)mir_alloc(sizeof(wchar_t)* (mir_wstrlen(tmp) + 1));
mir_wstrcpy(inclosetag, tmp);
GetDlgItemText(hwndDlg, IDC_OUT_OPEN_TAG, tmp, _countof(tmp));
- db_set_ts(NULL, szGPGModuleName, "szOutOpenTag", tmp);
+ db_set_ws(NULL, szGPGModuleName, "szOutOpenTag", tmp);
mir_free(outopentag);
outopentag = (wchar_t*)mir_alloc(sizeof(wchar_t)* (mir_wstrlen(tmp) + 1));
mir_wstrcpy(outopentag, tmp);
GetDlgItemText(hwndDlg, IDC_OUT_CLOSE_TAG, tmp, _countof(tmp));
- db_set_ts(NULL, szGPGModuleName, "szOutCloseTag", tmp);
+ db_set_ws(NULL, szGPGModuleName, "szOutCloseTag", tmp);
mir_free(outclosetag);
outclosetag = (wchar_t*)mir_alloc(sizeof(wchar_t)*(mir_wstrlen(tmp) + 1));
mir_wstrcpy(outclosetag, tmp);
@@ -783,12 +783,12 @@ static INT_PTR CALLBACK DlgProcLoadPublicKey(HWND hwndDlg, UINT uMsg, WPARAM wPa
for (int i = 0; i < count; i++) {
MCONTACT hcnt = db_mc_getSub(hContact, i);
if (hcnt)
- db_set_ts(hcnt, szGPGModuleName, "GPGPubKey", key_buf.substr(ws1, ws2 - ws1).c_str());
+ db_set_ws(hcnt, szGPGModuleName, "GPGPubKey", key_buf.substr(ws1, ws2 - ws1).c_str());
}
}
- else db_set_ts(metaGetMostOnline(hContact), szGPGModuleName, "GPGPubKey", key_buf.substr(ws1, ws2 - ws1).c_str());
+ else db_set_ws(metaGetMostOnline(hContact), szGPGModuleName, "GPGPubKey", key_buf.substr(ws1, ws2 - ws1).c_str());
}
- else db_set_ts(hContact, szGPGModuleName, "GPGPubKey", key_buf.substr(ws1, ws2 - ws1).c_str());
+ else db_set_ws(hContact, szGPGModuleName, "GPGPubKey", key_buf.substr(ws1, ws2 - ws1).c_str());
}
tmp = (wchar_t*)mir_alloc(sizeof(wchar_t) * (key_buf.length() + 1));
mir_wstrcpy(tmp, key_buf.substr(ws1, ws2 - ws1).c_str());
diff --git a/plugins/New_GPG/src/utilities.cpp b/plugins/New_GPG/src/utilities.cpp
index a0359340a9..466c7f6a14 100755
--- a/plugins/New_GPG/src/utilities.cpp
+++ b/plugins/New_GPG/src/utilities.cpp
@@ -28,7 +28,7 @@ wchar_t* __stdcall UniGetContactSettingUtf(MCONTACT hContact, const char *szModu
{
DBVARIANT dbv = { DBVT_DELETED };
wchar_t* szRes = NULL;
- if (db_get_ts(hContact, szModule, szSetting, &dbv))
+ if (db_get_ws(hContact, szModule, szSetting, &dbv))
return mir_wstrdup(szDef);
else if (dbv.pszVal)
szRes = mir_wstrdup(dbv.ptszVal);
@@ -77,7 +77,7 @@ void GetFilePath(wchar_t *WindowTittle, char *szSetting, wchar_t *szExt, wchar_t
ofn.nMaxFileTitle = MAX_PATH;
if (!GetOpenFileName(&ofn))
return;
- db_set_ts(0, szGPGModuleName, szSetting, str);
+ db_set_ws(0, szGPGModuleName, szSetting, str);
}
wchar_t *GetFilePath(wchar_t *WindowTittle, wchar_t *szExt, wchar_t *szExtDesc, bool save_file)
@@ -124,7 +124,7 @@ void GetFolderPath(wchar_t *WindowTittle, char*)
if (pidl != 0) {
wchar_t path[MAX_PATH];
if (SHGetPathFromIDList(pidl, path)) {
- db_set_ts(NULL, szGPGModuleName, "szHomePath", path);
+ db_set_ws(NULL, szGPGModuleName, "szHomePath", path);
}
IMalloc * imalloc = 0;
if (SUCCEEDED(SHGetMalloc(&imalloc))) {
@@ -1034,7 +1034,7 @@ bool isGPGValid()
}
if (gpg_exists) {
- db_set_ts(NULL, szGPGModuleName, "szGpgBinPath", tmp);
+ db_set_ws(NULL, szGPGModuleName, "szGpgBinPath", tmp);
mir_free(tmp);
tmp = NULL;
string out;
@@ -1705,7 +1705,7 @@ INT_PTR ImportGpGKeys(WPARAM, LPARAM)
}
}
db_set_b(hContact, szGPGModuleName, "GPGEncryption", 1);
- db_set_ts(hContact, szGPGModuleName, "GPGPubKey", toUTF16(key).c_str());
+ db_set_ws(hContact, szGPGModuleName, "GPGPubKey", toUTF16(key).c_str());
}
boost::filesystem::remove(path);
break;