diff options
Diffstat (limited to 'plugins/New_GPG/src')
-rwxr-xr-x | plugins/New_GPG/src/gpg_wrapper.cpp | 6 | ||||
-rwxr-xr-x | plugins/New_GPG/src/main.cpp | 24 | ||||
-rwxr-xr-x | plugins/New_GPG/src/options.cpp | 4 | ||||
-rwxr-xr-x | plugins/New_GPG/src/utilities.cpp | 4 |
4 files changed, 15 insertions, 23 deletions
diff --git a/plugins/New_GPG/src/gpg_wrapper.cpp b/plugins/New_GPG/src/gpg_wrapper.cpp index 5f9df7dfd1..bfa359d69a 100755 --- a/plugins/New_GPG/src/gpg_wrapper.cpp +++ b/plugins/New_GPG/src/gpg_wrapper.cpp @@ -74,7 +74,7 @@ pxResult pxExecute(std::vector<std::wstring> &aargv, string *aoutput, LPDWORD ae file_descriptor_sink sout(pout.sink, close_handle); char *mir_path = new char [MAX_PATH]; - CallService(MS_UTILS_PATHTOABSOLUTE, (WPARAM)"\\", (LPARAM)mir_path); + PathToAbsolute("\\", mir_path); child c = execute(set_args(argv), bind_stdout(sout), /*bind_stdin(sin),*/ show_window(SW_HIDE), hide_console(), inherit_env(), set_env(env), start_in_dir(toUTF16(mir_path))); _child = &c; @@ -185,7 +185,7 @@ pxResult pxExecute_passwd_change(std::vector<std::wstring> &aargv, string *aoutp // file_descriptor_source sin(pin.source, close_handle); char *mir_path = new char [MAX_PATH]; - CallService(MS_UTILS_PATHTOABSOLUTE, (WPARAM)"\\", (LPARAM)mir_path); + PathToAbsolute("\\", mir_path); //execute(set_args(argv), bind_stdout(sout), bind_stdin(sin), show_window(SW_HIDE), hide_console(), inherit_env(), set_env(env), start_in_dir(toUTF16(mir_path))); child c = execute(set_args(argv), /*bind_stdin(sin), */inherit_env(), set_env(env), start_in_dir(toUTF16(mir_path))); @@ -230,7 +230,7 @@ pxResult pxExecute_passwd_change(std::vector<std::wstring> &aargv, string *aoutp ctx.environment["LC_ALL"] = "English"; char *mir_path = new char [MAX_PATH]; - CallService(MS_UTILS_PATHTOABSOLUTE, (WPARAM)"\\", (LPARAM)mir_path); + PathToAbsolute("\\", mir_path); ctx.work_directory = mir_path; delete [] mir_path; diff --git a/plugins/New_GPG/src/main.cpp b/plugins/New_GPG/src/main.cpp index c70022a8d9..3b5f63ea19 100755 --- a/plugins/New_GPG/src/main.cpp +++ b/plugins/New_GPG/src/main.cpp @@ -860,7 +860,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, bool gpg_exists = false, lang_exists = false;
{
char *mir_path = (char*)mir_alloc(sizeof(char) * MAX_PATH);
- CallService(MS_UTILS_PATHTOABSOLUTE, (WPARAM)"\\", (LPARAM)mir_path);
+ PathToAbsolute("\\", mir_path);
SetCurrentDirectoryA(mir_path);
tmp = mir_a2t(mir_path);
mir_free(mir_path);
@@ -888,20 +888,12 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, {
tmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "szGpgBinPath", (SHGetValue(HKEY_CURRENT_USER, _T("Software\\GNU\\GnuPG"), _T("gpgProgram"), 0, path, &len) == ERROR_SUCCESS)?path:_T(""));
if(tmp[0])
- {
if(!boost::filesystem::exists(tmp))
- {
MessageBox(0, TranslateT("wrong gpg binary location found in system.\nplease choose another location"), TranslateT("Warning"), MB_OK);
- }
-/* char *mir_path = (char*)mir_alloc(MAX_PATH);
- CallService(MS_UTILS_PATHTOABSOLUTE, (WPARAM)"\\", (LPARAM)mir_path);
- SetCurrentDirectoryA(mir_path);
- mir_free(mir_path); */
- }
}
- else
- tmp = mir_wstrdup(path);
+ else tmp = mir_wstrdup(path);
mir_free(path);
+
SetDlgItemText(hwndDlg, IDC_BIN_PATH, tmp);
bool bad_version = false;
if(gpg_exists/* && lang_exists*/)
@@ -942,7 +934,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, {
mir_free(tmp);
char *mir_path = (char*)mir_alloc(sizeof(char) * MAX_PATH);
- CallService(MS_UTILS_PATHTOABSOLUTE, (WPARAM)"\\", (LPARAM)mir_path);
+ PathToAbsolute("\\", mir_path);
strcat(mir_path, "\\gpg");
if(_access(mir_path, 0) != -1)
{
@@ -980,7 +972,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, char mir_path[MAX_PATH];
char *atmp = mir_t2a(tmp);
mir_free(tmp);
- CallService(MS_UTILS_PATHTOABSOLUTE, (WPARAM)"\\", (LPARAM)mir_path);
+ PathToAbsolute("\\", mir_path);
char* p_path = NULL;
if(StriStr(atmp, mir_path))
{
@@ -998,7 +990,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, char mir_path[MAX_PATH];
char *atmp = mir_t2a(tmp);
mir_free(tmp);
- CallService(MS_UTILS_PATHTOABSOLUTE, (WPARAM)"\\", (LPARAM)mir_path);
+ PathToAbsolute("\\", mir_path);
char* p_path = NULL;
if(StriStr(atmp, mir_path))
{
@@ -1015,7 +1007,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, if(tmp[0])
{
char *mir_path = new char [MAX_PATH];
- CallService(MS_UTILS_PATHTOABSOLUTE, (WPARAM)"\\", (LPARAM)mir_path);
+ PathToAbsolute("\\", mir_path);
SetCurrentDirectoryA(mir_path);
delete [] mir_path;
if(!boost::filesystem::exists(tmp))
@@ -1093,7 +1085,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, if(tmp[0])
{
char *mir_path = new char [MAX_PATH];
- CallService(MS_UTILS_PATHTOABSOLUTE, (WPARAM)"\\", (LPARAM)mir_path);
+ PathToAbsolute("\\", mir_path);
SetCurrentDirectoryA(mir_path);
delete [] mir_path;
if(!boost::filesystem::exists(tmp))
diff --git a/plugins/New_GPG/src/options.cpp b/plugins/New_GPG/src/options.cpp index 4e63d6f17d..32cc4160ac 100755 --- a/plugins/New_GPG/src/options.cpp +++ b/plugins/New_GPG/src/options.cpp @@ -548,7 +548,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, char mir_path[MAX_PATH]; char *atmp = mir_t2a(tmp); mir_free(tmp); - CallService(MS_UTILS_PATHTOABSOLUTE, (WPARAM)"\\", (LPARAM)mir_path); + PathToAbsolute("\\", mir_path); char* p_path = NULL; if(StriStr(atmp, mir_path)) { @@ -566,7 +566,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, char mir_path[MAX_PATH]; char *atmp = mir_t2a(tmp); mir_free(tmp); - CallService(MS_UTILS_PATHTOABSOLUTE, (WPARAM)"\\", (LPARAM)mir_path); + PathToAbsolute("\\", mir_path); char* p_path = NULL; if(StriStr(atmp, mir_path)) { diff --git a/plugins/New_GPG/src/utilities.cpp b/plugins/New_GPG/src/utilities.cpp index 8e56388172..b6e7cc8fc4 100755 --- a/plugins/New_GPG/src/utilities.cpp +++ b/plugins/New_GPG/src/utilities.cpp @@ -1135,7 +1135,7 @@ bool isGPGValid() mir_free(tmp);
TCHAR *path = (TCHAR*)mir_alloc(sizeof(TCHAR)*MAX_PATH);
char *mir_path = (char*)mir_alloc(MAX_PATH);
- CallService(MS_UTILS_PATHTOABSOLUTE, (WPARAM)"\\", (LPARAM)mir_path);
+ PathToAbsolute("\\", mir_path);
SetCurrentDirectoryA(mir_path);
tmp = mir_a2t(mir_path);
mir_free(mir_path);
@@ -2207,7 +2207,7 @@ void clean_temp_dir() {
using namespace boost::filesystem; char *mir_path = new char [MAX_PATH]; - CallService(MS_UTILS_PATHTOABSOLUTE, (WPARAM)"\\", (LPARAM)mir_path); + PathToAbsolute("\\", mir_path); wstring path = toUTF16(mir_path); SetCurrentDirectoryA(mir_path); delete [] mir_path; |