diff options
author | George Hazan <george.hazan@gmail.com> | 2023-11-01 12:56:12 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2023-11-01 12:56:12 +0300 |
commit | 5e1234ce647a66915353c5c838363b1b67ebfac0 (patch) | |
tree | 3d4f134f9f0a901163ddfc35e5c2ffacc0db0693 | |
parent | ccd47813d774540317912de65e0ffb4300dbfbb9 (diff) |
unused ANSI service MS_FILE_GETRECEIVEDFILESFOLDER removed
-rw-r--r-- | include/m_file.h | 5 | ||||
-rw-r--r-- | plugins/HistoryPlusPlus/EventDetailForm.pas | 4 | ||||
-rw-r--r-- | plugins/HistoryPlusPlus/GlobalSearch.pas | 4 | ||||
-rw-r--r-- | plugins/HistoryPlusPlus/HistoryForm.pas | 4 | ||||
-rw-r--r-- | plugins/HistoryPlusPlus/hpp_externalgrid.pas | 4 | ||||
-rw-r--r-- | plugins/MenuItemEx/src/main.cpp | 10 | ||||
-rw-r--r-- | plugins/NewStory/src/history_array.cpp | 4 | ||||
-rw-r--r-- | src/mir_app/src/file.cpp | 11 |
8 files changed, 17 insertions, 29 deletions
diff --git a/include/m_file.h b/include/m_file.h index 7f8ccbb170..9e616a57d6 100644 --- a/include/m_file.h +++ b/include/m_file.h @@ -54,14 +54,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define MS_FILE_SENDSPECIFICFILEST "SRFile/SendSpecificFilesT"
// wParam = (MCONTACT)hContact
-// lParam = (LPARAM)(char *)pszOutput
+// lParam = (LPARAM)(wchar_t *)pszOutput
// returns 0 on success or nonzero on failure
// pszOutput must be at least MAX_PATH characters long
// If hContact is NULL this function will retrieve the received files folder
// name without any appended user names.
// Note that the directory name returned by this function does not necessarily exist.
-#define MS_FILE_GETRECEIVEDFILESFOLDER "SRFile/GetReceivedFilesFolder"
-#define MS_FILE_GETRECEIVEDFILESFOLDERW "SRFile/GetReceivedFilesFolderW"
+#define MS_FILE_GETRECEIVEDFILESFOLDER "SRFile/GetReceivedFilesFolder"
// notifies a caller about file send start
// wParam = (MCONTACT)hContact
diff --git a/plugins/HistoryPlusPlus/EventDetailForm.pas b/plugins/HistoryPlusPlus/EventDetailForm.pas index eedae3bc66..06bffc478d 100644 --- a/plugins/HistoryPlusPlus/EventDetailForm.pas +++ b/plugins/HistoryPlusPlus/EventDetailForm.pas @@ -676,10 +676,10 @@ end; procedure TEventDetailsFrm.BrowseReceivedFilesClick(Sender: TObject);
var
- Path: Array [0 .. MAX_PATH] of AnsiChar;
+ Path: Array [0 .. MAX_PATH] of WideChar;
begin
CallService(MS_FILE_GETRECEIVEDFILESFOLDER, FParentForm.hContact, LPARAM(@Path));
- ShellExecuteA(0, 'open', Path, nil, nil, SW_SHOW);
+ ShellExecuteW(0, 'open', Path, nil, nil, SW_SHOW);
end;
procedure TEventDetailsFrm.ETextURLClick(Sender: TObject; const URLText: String; Button: TMouseButton);
diff --git a/plugins/HistoryPlusPlus/GlobalSearch.pas b/plugins/HistoryPlusPlus/GlobalSearch.pas index 2ae098591a..b7cafc091e 100644 --- a/plugins/HistoryPlusPlus/GlobalSearch.pas +++ b/plugins/HistoryPlusPlus/GlobalSearch.pas @@ -2450,12 +2450,12 @@ end; procedure TfmGlobalSearch.BrowseReceivedFilesClick(Sender: TObject);
var
- Path: Array [0 .. MAX_PATH] of AnsiChar;
+ Path: Array [0 .. MAX_PATH] of WideChar;
hContact: THandle;
begin
hContact := GetSearchItem(hg.Selected).Contact.Handle;
CallService(MS_FILE_GETRECEIVEDFILESFOLDER, hContact, LParam(@Path));
- ShellExecuteA(0, 'open', Path, nil, nil, SW_SHOW);
+ ShellExecuteW(0, 'open', Path, nil, nil, SW_SHOW);
end;
procedure TfmGlobalSearch.tbEventsClick(Sender: TObject);
diff --git a/plugins/HistoryPlusPlus/HistoryForm.pas b/plugins/HistoryPlusPlus/HistoryForm.pas index 3b50cfe5a5..ad1bc32035 100644 --- a/plugins/HistoryPlusPlus/HistoryForm.pas +++ b/plugins/HistoryPlusPlus/HistoryForm.pas @@ -3796,10 +3796,10 @@ end; procedure THistoryFrm.BrowseReceivedFilesClick(Sender: TObject);
var
- Path: Array [0 .. MAX_PATH] of AnsiChar;
+ Path: Array [0 .. MAX_PATH] of WideChar;
begin
CallService(MS_FILE_GETRECEIVEDFILESFOLDER, hContact, lParam(@Path));
- ShellExecuteA(0, 'open', Path, nil, nil, SW_SHOW);
+ ShellExecuteW(0, 'open', Path, nil, nil, SW_SHOW);
end;
procedure THistoryFrm.hgOptionsChange(Sender: TObject);
diff --git a/plugins/HistoryPlusPlus/hpp_externalgrid.pas b/plugins/HistoryPlusPlus/hpp_externalgrid.pas index b67e82c1f6..197b91db89 100644 --- a/plugins/HistoryPlusPlus/hpp_externalgrid.pas +++ b/plugins/HistoryPlusPlus/hpp_externalgrid.pas @@ -1329,12 +1329,12 @@ end; procedure TExternalGrid.OnBrowseReceivedFilesClick(Sender: TObject);
var
- Path: Array [0 .. MAX_PATH] of AnsiChar;
+ Path: Array [0 .. MAX_PATH] of WideChar;
begin
if Grid.Selected = -1 then
exit;
CallService(MS_FILE_GETRECEIVEDFILESFOLDER, Items[Grid.Selected].hContact,LParam(@Path));
- ShellExecuteA(0, 'open', Path, nil, nil, SW_SHOW);
+ ShellExecuteW(0, 'open', Path, nil, nil, SW_SHOW);
end;
end.
diff --git a/plugins/MenuItemEx/src/main.cpp b/plugins/MenuItemEx/src/main.cpp index 3684defb91..0a76189564 100644 --- a/plugins/MenuItemEx/src/main.cpp +++ b/plugins/MenuItemEx/src/main.cpp @@ -206,10 +206,10 @@ static void ShowPopup(const wchar_t *pwszText, MCONTACT hContact) BOOL DirectoryExists(MCONTACT hContact)
{
- char path[MAX_PATH];
+ wchar_t path[MAX_PATH];
CallService(MS_FILE_GETRECEIVEDFILESFOLDER, hContact, (LPARAM)&path);
- uint32_t attr = GetFileAttributesA(path);
- return (attr != -1) && (attr&FILE_ATTRIBUTE_DIRECTORY);
+ uint32_t attr = GetFileAttributesW(path);
+ return (attr != -1) && (attr & FILE_ATTRIBUTE_DIRECTORY);
}
BOOL isMetaContact(MCONTACT hContact)
@@ -543,9 +543,9 @@ static INT_PTR OpenIgnoreOptions(WPARAM, LPARAM) static INT_PTR onRecvFiles(WPARAM hContact, LPARAM)
{
- char path[MAX_PATH];
+ wchar_t path[MAX_PATH];
CallService(MS_FILE_GETRECEIVEDFILESFOLDER, hContact, (LPARAM)&path);
- ShellExecuteA(nullptr, "open", path, nullptr, nullptr, SW_SHOW);
+ ShellExecuteW(nullptr, L"open", path, nullptr, nullptr, SW_SHOW);
return 0;
}
diff --git a/plugins/NewStory/src/history_array.cpp b/plugins/NewStory/src/history_array.cpp index eedcbb0b9b..edb47276b6 100644 --- a/plugins/NewStory/src/history_array.cpp +++ b/plugins/NewStory/src/history_array.cpp @@ -244,7 +244,7 @@ void ItemData::fill(int tmpl) dbe.eventType = EVENTTYPE_JABBER_PRESENCE; break; default: - dbe.eventType = 309247; + dbe.eventType = 9247; break; } } @@ -373,7 +373,7 @@ void ItemData::load(bool bFullLoad) } wchar_t buf[MAX_PATH]; - CallService(MS_FILE_GETRECEIVEDFILESFOLDERW, hContact, (LPARAM)buf); + CallService(MS_FILE_GETRECEIVEDFILESFOLDER, hContact, (LPARAM)buf); CMStringW wszFileName = buf; wszFileName.Append(blob.getName()); diff --git a/src/mir_app/src/file.cpp b/src/mir_app/src/file.cpp index f03c67795f..04cc6c0af8 100644 --- a/src/mir_app/src/file.cpp +++ b/src/mir_app/src/file.cpp @@ -87,16 +87,6 @@ static INT_PTR GetReceivedFilesFolder(WPARAM hContact, LPARAM lParam) { wchar_t buf[MAX_PATH]; GetContactReceivedFilesDir(hContact, buf, _countof(buf), TRUE); - char *dir = mir_u2a(buf); - mir_strncpy((char *)lParam, dir, MAX_PATH); - mir_free(dir); - return 0; -} - -static INT_PTR GetReceivedFilesFolderW(WPARAM hContact, LPARAM lParam) -{ - wchar_t buf[MAX_PATH]; - GetContactReceivedFilesDir(hContact, buf, _countof(buf), TRUE); mir_wstrncpy((wchar_t *)lParam, buf, MAX_PATH); return 0; } @@ -364,7 +354,6 @@ int LoadSendRecvFileModule(void) CreateServiceFunction(MS_FILE_SENDSPECIFICFILES, SendSpecificFiles); CreateServiceFunction(MS_FILE_SENDSPECIFICFILEST, SendSpecificFilesT); CreateServiceFunction(MS_FILE_GETRECEIVEDFILESFOLDER, GetReceivedFilesFolder); - CreateServiceFunction(MS_FILE_GETRECEIVEDFILESFOLDERW, GetReceivedFilesFolderW); CreateServiceFunction("SRFile/RecvFile", RecvFileCommand); CreateServiceFunction("SRFile/OpenContRecDir", openContRecDir); |