diff options
author | George Hazan <george.hazan@gmail.com> | 2013-02-23 19:43:21 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-02-23 19:43:21 +0000 |
commit | aa387fa04aa096d163932d3f5f9711a2f146c6f0 (patch) | |
tree | 7efe5dabf5bf5b9a78f8f991522487814bfc8cb0 /protocols/MRA | |
parent | 139c2c1a61d9f765704a2001199c2712d6587fb4 (diff) |
- PROTO_INTERFACE::GetIcon removed and replaced with the standard implementation;
- PS_LOADICON also replaced with the standard function;
- ProtoConstructor() & ProtoDestructor() macroses are introduced to simplify protocols' code;
- GetIcon() method implementation removed from all protocols
git-svn-id: http://svn.miranda-ng.org/main/trunk@3739 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/MRA')
-rw-r--r-- | protocols/MRA/src/MraProto.cpp | 24 | ||||
-rw-r--r-- | protocols/MRA/src/MraProto.h | 1 |
2 files changed, 4 insertions, 21 deletions
diff --git a/protocols/MRA/src/MraProto.cpp b/protocols/MRA/src/MraProto.cpp index 05a592fa25..42e6b29ada 100644 --- a/protocols/MRA/src/MraProto.cpp +++ b/protocols/MRA/src/MraProto.cpp @@ -10,10 +10,7 @@ static int MraExtraIconsApplyAll(WPARAM, LPARAM) CMraProto::CMraProto(const char* _module, const TCHAR* _displayName) :
m_bLoggedIn(false)
{
- m_iVersion = 2;
- m_iStatus = m_iDesiredStatus = ID_STATUS_OFFLINE;
- m_szModuleName = mir_strdup(_module);
- m_tszUserName = mir_tstrdup(_displayName);
+ ProtoConstructor(this, _module, _displayName);
InitializeCriticalSectionAndSpinCount(&csCriticalSectionSend, 0);
MraSendQueueInitialize(0, &hSendQueueHandle);
@@ -41,8 +38,7 @@ CMraProto::CMraProto(const char* _module, const TCHAR* _displayName) : TCHAR name[128];
mir_sntprintf( name, SIZEOF(name), TranslateT("%s connection"), m_tszUserName);
- NETLIBUSER nlu = {0};
- nlu.cbSize = sizeof(nlu);
+ NETLIBUSER nlu = { sizeof(nlu) };
nlu.flags = NUF_INCOMING | NUF_OUTGOING | NUF_HTTPCONNS | NUF_UNICODE;
nlu.szSettingsModule = m_szModuleName;
nlu.ptszDescriptiveName = name;
@@ -87,6 +83,8 @@ CMraProto::~CMraProto() MraFilesQueueDestroy(hFilesQueueHandle);
MraSendQueueDestroy(hSendQueueHandle);
DeleteCriticalSection(&csCriticalSectionSend);
+
+ ProtoDestructor(this);
}
INT_PTR CMraProto::MraCreateAccMgrUI(WPARAM wParam,LPARAM lParam)
@@ -375,20 +373,6 @@ DWORD_PTR CMraProto::GetCaps(int type, HANDLE hContact) }
}
-HICON CMraProto::GetIcon(int iconIndex)
-{
- UINT id;
-
- switch (iconIndex & 0xFFFF) {
- case PLI_PROTOCOL: id = IDI_MRA; break; // IDI_TM is the main icon for the protocol
- default: return NULL;
- }
-
- return (HICON)LoadImage(masMraSettings.hInstance, MAKEINTRESOURCE(id), IMAGE_ICON,
- GetSystemMetrics((iconIndex & PLIF_SMALL) ? SM_CXSMICON : SM_CXICON),
- GetSystemMetrics((iconIndex & PLIF_SMALL) ? SM_CYSMICON : SM_CYICON), 0);
-}
-
int CMraProto::GetInfo(HANDLE hContact, int infoType)
{
return MraUpdateContactInfo(hContact) != 0;
diff --git a/protocols/MRA/src/MraProto.h b/protocols/MRA/src/MraProto.h index 641938162a..5576640571 100644 --- a/protocols/MRA/src/MraProto.h +++ b/protocols/MRA/src/MraProto.h @@ -58,7 +58,6 @@ struct CMraProto : public PROTO_INTERFACE, public MZeroedObject virtual int __cdecl FileResume(HANDLE hTransfer, int* action, const TCHAR** szFilename);
virtual DWORD_PTR __cdecl GetCaps(int type, HANDLE hContact = NULL);
- virtual HICON __cdecl GetIcon(int iconIndex);
virtual int __cdecl GetInfo(HANDLE hContact, int infoType);
virtual HANDLE __cdecl SearchBasic(const TCHAR* id);
|