diff options
author | George Hazan <ghazan@miranda.im> | 2020-03-16 18:49:00 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2020-03-16 18:49:00 +0300 |
commit | 2a8d021d23e93ddb7c7a466965e55a170dcabd60 (patch) | |
tree | 60765e22fb2c3e3c32609c766f7ce4f31c522099 /plugins/New_GPG/src/options.cpp | |
parent | 0fa627b2e173ee95fe5c422545d26db02e4e327a (diff) |
NewGPG:
- useless button control ids removed;
- GetFilePath() calls rewritten using ptrW;
- code cleaning
Diffstat (limited to 'plugins/New_GPG/src/options.cpp')
-rwxr-xr-x | plugins/New_GPG/src/options.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/plugins/New_GPG/src/options.cpp b/plugins/New_GPG/src/options.cpp index 6728343fe5..c907cf2165 100755 --- a/plugins/New_GPG/src/options.cpp +++ b/plugins/New_GPG/src/options.cpp @@ -243,13 +243,12 @@ public: void onClick_SAVE_KEY_BUTTON(CCtrlButton*) { - wchar_t *tmp = GetFilePath(TranslateT("Export public key"), L"*", TranslateT(".asc pubkey file"), true); + ptrW tmp(GetFilePath(TranslateT("Export public key"), L"*", TranslateT(".asc pubkey file"), true)); if (tmp) { CMStringW str(g_plugin.getMStringW(globals.user_data[item_num + 1], "GPGPubKey")); str.Replace(L"\r", L""); wfstream f(tmp, std::ios::out); - delete[] tmp; f << str.c_str(); f.close(); } @@ -953,14 +952,13 @@ public: this->Close(); } - void onClick_LOAD_FROM_FILE(CCtrlButton*) + void onClick_LOAD_FROM_FILE(CCtrlButton *) { - wchar_t *tmp = GetFilePath(TranslateT("Set file containing GPG public key"), L"*", TranslateT("GPG public key file")); + ptrW tmp(GetFilePath(TranslateT("Set file containing GPG public key"), L"*", TranslateT("GPG public key file"))); if (!tmp) return; wfstream f(tmp, std::ios::in | std::ios::ate | std::ios::binary); - delete[] tmp; if (!f.is_open()) { MessageBox(nullptr, TranslateT("Failed to open file"), TranslateT("Error"), MB_OK); return; @@ -995,7 +993,8 @@ public: edit_PUBLIC_KEY_EDIT.SetText(key_buf.substr(ws1, ws2 - ws1).c_str()); key_buf.clear(); } - void onClick_IMPORT(CCtrlButton*) + + void onClick_IMPORT(CCtrlButton *) { CDlgImportKey *d = new CDlgImportKey(hContact); d->Show(); |