diff options
author | George Hazan <george.hazan@gmail.com> | 2015-05-28 17:16:36 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-05-28 17:16:36 +0000 |
commit | 84b5cac8e0f148250c44fc91d7d9752dca13dbb6 (patch) | |
tree | fbb1f7d612419ea7ff02770ca5e5af31c28ebd61 /protocols | |
parent | e22f3f791caefb016c7ba72256c325609f6a5a5b (diff) |
- MS_UTILS_GETBITMAPFILTERSTRINGS - end of story, replaced with BmpFilterGetStrings();
- parasite mir_strncat's removed from bitmap filter creation;
- CMString::AllocSysString/SetSysString removed due to complete uselessness;
- CMString::Detouch - typo fixed.
git-svn-id: http://svn.miranda-ng.org/main/trunk@13881 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols')
-rw-r--r-- | protocols/JabberG/src/jabber_vcard.cpp | 6 | ||||
-rw-r--r-- | protocols/SkypeClassic/src/skype.cpp | 14 | ||||
-rw-r--r-- | protocols/SkypeClassic/src/skype.h | 2 | ||||
-rw-r--r-- | protocols/SkypeClassic/src/skypeopt.cpp | 13 | ||||
-rw-r--r-- | protocols/Tlen/src/tlen_picture.cpp | 21 | ||||
-rw-r--r-- | protocols/WhatsApp/src/chat.cpp | 6 |
6 files changed, 29 insertions, 33 deletions
diff --git a/protocols/JabberG/src/jabber_vcard.cpp b/protocols/JabberG/src/jabber_vcard.cpp index c5e7ba3036..9952d6e826 100644 --- a/protocols/JabberG/src/jabber_vcard.cpp +++ b/protocols/JabberG/src/jabber_vcard.cpp @@ -333,10 +333,8 @@ static INT_PTR CALLBACK PhotoDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR break;
case IDC_LOAD:
- TCHAR szFilter[512];
- TCHAR szFileName[MAX_PATH];
-
- CallService(MS_UTILS_GETBITMAPFILTERSTRINGST, SIZEOF(szFilter), (LPARAM)szFilter);
+ TCHAR szFilter[512], szFileName[MAX_PATH];
+ BmpFilterGetStrings(szFilter, SIZEOF(szFilter));
OPENFILENAME ofn = { 0 };
ofn.lStructSize = sizeof(ofn);
diff --git a/protocols/SkypeClassic/src/skype.cpp b/protocols/SkypeClassic/src/skype.cpp index 147b467ecc..e0bf3fe270 100644 --- a/protocols/SkypeClassic/src/skype.cpp +++ b/protocols/SkypeClassic/src/skype.cpp @@ -2907,21 +2907,21 @@ void CleanupNicknames(char *) { /////////////////////////////////////////////////////////////////////////////////////////
// EnterBitmapFileName - enters a bitmap filename
-int __stdcall EnterBitmapFileName(char* szDest)
+int __stdcall EnterBitmapFileName(TCHAR *szDest)
{
- char szFilter[512];
- OPENFILENAMEA ofn = { 0 };
- *szDest = 0;
+ TCHAR szFilter[512];
+ BmpFilterGetStrings(szFilter, SIZEOF(szFilter));
- CallService(MS_UTILS_GETBITMAPFILTERSTRINGS, sizeof szFilter, (LPARAM)szFilter);
+ *szDest = 0;
+ OPENFILENAME ofn = { 0 };
ofn.lStructSize = sizeof(OPENFILENAME);
ofn.lpstrFilter = szFilter;
ofn.lpstrFile = szDest;
ofn.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY;
ofn.nMaxFile = MAX_PATH;
ofn.nMaxFileTitle = MAX_PATH;
- ofn.lpstrDefExt = "bmp";
- if (!GetOpenFileNameA(&ofn))
+ ofn.lpstrDefExt = _T("bmp");
+ if (!GetOpenFileName(&ofn))
return 1;
return ERROR_SUCCESS;
diff --git a/protocols/SkypeClassic/src/skype.h b/protocols/SkypeClassic/src/skype.h index 7ad0ce8a99..bc4f9b2b67 100644 --- a/protocols/SkypeClassic/src/skype.h +++ b/protocols/SkypeClassic/src/skype.h @@ -145,7 +145,7 @@ time_t SkypeTime(time_t *timer); void MessageSendWatchThread(void*);
int OkToExit(WPARAM wParam, LPARAM lParam);
int MirandaExit(WPARAM wParam, LPARAM lParam);
-int __stdcall EnterBitmapFileName( char* szDest );
+int __stdcall EnterBitmapFileName(TCHAR *szDest);
void CleanupNicknames(char *dummy);
int InitVSApi();
int FreeVSApi();
diff --git a/protocols/SkypeClassic/src/skypeopt.cpp b/protocols/SkypeClassic/src/skypeopt.cpp index 358a95e153..ba9f04275f 100644 --- a/protocols/SkypeClassic/src/skypeopt.cpp +++ b/protocols/SkypeClassic/src/skypeopt.cpp @@ -780,18 +780,17 @@ INT_PTR CALLBACK AvatarDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM) if ( HIWORD( wParam ) == BN_CLICKED ) {
switch( LOWORD( wParam )) {
case IDC_SETAVATAR:
- {
- char szFileName[ MAX_PATH ];
- if ( EnterBitmapFileName( szFileName ) != ERROR_SUCCESS )
+ TCHAR szFileName[ MAX_PATH ];
+ if (EnterBitmapFileName(szFileName) != ERROR_SUCCESS)
return FALSE;
- hAvatar = ( HBITMAP )CallService( MS_UTILS_LOADBITMAP, 0, ( LPARAM )szFileName);
- if ( hAvatar != NULL ){
- SendDlgItemMessage(hwndDlg, IDC_AVATAR, STM_SETIMAGE, IMAGE_BITMAP, (WPARAM)hAvatar );
+ hAvatar = (HBITMAP)CallService(MS_UTILS_LOADBITMAPT, 0, (LPARAM)szFileName);
+ if (hAvatar != NULL){
+ SendDlgItemMessage(hwndDlg, IDC_AVATAR, STM_SETIMAGE, IMAGE_BITMAP, (WPARAM)hAvatar);
CallService(SKYPE_SETAVATAR, 0, ( LPARAM )szFileName);
}
break;
- }
+
case IDC_DELETEAVATAR:
if ( hAvatar != NULL ) {
DeleteObject( hAvatar );
diff --git a/protocols/Tlen/src/tlen_picture.cpp b/protocols/Tlen/src/tlen_picture.cpp index cc7163c13f..adfd6ea1ca 100644 --- a/protocols/Tlen/src/tlen_picture.cpp +++ b/protocols/Tlen/src/tlen_picture.cpp @@ -258,21 +258,21 @@ BOOL SendPicture(TlenProtocol *proto, MCONTACT hContact) { DBVARIANT dbv;
if (!db_get(hContact, proto->m_szModuleName, "jid", &dbv)) {
char *jid = dbv.pszVal;
- char szFilter[512];
- char *szFileName = (char*) mir_alloc(_MAX_PATH);
- OPENFILENAMEA ofn = {0};
- CallService(MS_UTILS_GETBITMAPFILTERSTRINGS, ( WPARAM ) sizeof( szFilter ), ( LPARAM )szFilter );
+
+ TCHAR tszFilter[512], tszFileName[MAX_PATH];
+ BmpFilterGetStrings(tszFilter, SIZEOF(tszFilter));
+ tszFileName[0] = '\0';
+
+ OPENFILENAME ofn = {0};
ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400;
- ofn.hwndOwner = NULL;
- ofn.lpstrFilter = szFilter;
+ ofn.lpstrFilter = tszFilter;
ofn.lpstrCustomFilter = NULL;
- ofn.lpstrFile = szFileName;
+ ofn.lpstrFile = tszFileName;
ofn.nMaxFile = _MAX_PATH;
ofn.Flags = OFN_FILEMUSTEXIST;
- szFileName[0] = '\0';
- if ( GetOpenFileNameA( &ofn )) {
+ if (GetOpenFileName(&ofn)) {
long size;
- FILE* fp = fopen( szFileName, "rb" );
+ FILE* fp = _tfopen(tszFileName, _T("rb"));
if (fp) {
fseek(fp, 0, SEEK_END);
size = ftell(fp);
@@ -284,6 +284,7 @@ BOOL SendPicture(TlenProtocol *proto, MCONTACT hContact) { char idStr[10];
char fileBuffer[2048];
int id = TlenSerialNext(proto);
+ T2Utf szFileName(tszFileName);
mir_snprintf(idStr, SIZEOF(idStr), "%d", id);
item = TlenListAdd(proto, LIST_PICTURE, idStr);
item->ft = TlenFileCreateFT(proto, jid);
diff --git a/protocols/WhatsApp/src/chat.cpp b/protocols/WhatsApp/src/chat.cpp index 68ccac9a58..e768dde43c 100644 --- a/protocols/WhatsApp/src/chat.cpp +++ b/protocols/WhatsApp/src/chat.cpp @@ -165,10 +165,8 @@ void WhatsAppProto::EditChatSubject(WAChatInfo *pInfo) void WhatsAppProto::SetChatAvatar(WAChatInfo *pInfo)
{
- TCHAR tszFileName[MAX_PATH]; tszFileName[0] = '\0'; - - TCHAR filter[256]; filter[0] = '\0'; - CallService(MS_UTILS_GETBITMAPFILTERSTRINGST, SIZEOF(filter), (LPARAM)filter); + TCHAR tszFileName[MAX_PATH], filter[256]; + BmpFilterGetStrings(filter, SIZEOF(filter));
OPENFILENAME ofn = { 0 }; ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400; |