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/IRCG/src | |
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/IRCG/src')
-rw-r--r-- | protocols/IRCG/src/irc.h | 1 | ||||
-rw-r--r-- | protocols/IRCG/src/ircproto.cpp | 35 |
2 files changed, 5 insertions, 31 deletions
diff --git a/protocols/IRCG/src/irc.h b/protocols/IRCG/src/irc.h index 6928d21dda..82663a58bb 100644 --- a/protocols/IRCG/src/irc.h +++ b/protocols/IRCG/src/irc.h @@ -238,7 +238,6 @@ struct CIrcProto : 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 PROTOCHAR* id );
diff --git a/protocols/IRCG/src/ircproto.cpp b/protocols/IRCG/src/ircproto.cpp index 0c384234c0..f77bd5505d 100644 --- a/protocols/IRCG/src/ircproto.cpp +++ b/protocols/IRCG/src/ircproto.cpp @@ -29,16 +29,14 @@ static int CompareSessions( const CDccSession* p1, const CDccSession* p2 ) return INT_PTR( p1->di->hContact ) - INT_PTR( p2->di->hContact );
}
-CIrcProto::CIrcProto( const char* szModuleName, const TCHAR* tszUserName ) :
+CIrcProto::CIrcProto(const char* szModuleName, const TCHAR* tszUserName) :
m_dcc_chats( 10, CompareSessions ),
m_dcc_xfers( 10, CompareSessions ),
m_ignoreItems( 10 ),
vUserhostReasons( 10 ),
vWhoInProgress( 10 )
{
- m_iVersion = 2;
- m_tszUserName = mir_tstrdup( tszUserName );
- m_szModuleName = mir_strdup( szModuleName );
+ ProtoConstructor(this, szModuleName, tszUserName);
InitializeCriticalSection(&cs);
InitializeCriticalSection(&m_gchook);
@@ -165,14 +163,14 @@ CIrcProto::~CIrcProto() CallService( MS_CLIST_REMOVEMAINMENUITEM, ( WPARAM )hMenuRoot, 0 );
mir_free( m_alias );
- mir_free( m_szModuleName );
- mir_free( m_tszUserName );
CloseHandle( m_evWndCreate );
DeleteCriticalSection(&m_resolve);
DeleteCriticalSection(&m_dcc);
KillChatTimer(OnlineNotifTimer);
KillChatTimer(OnlineNotifTimer3);
+
+ ProtoDestructor(this);
}
////////////////////////////////////////////////////////////////////////////////////////
@@ -552,29 +550,6 @@ DWORD_PTR __cdecl CIrcProto::GetCaps( int type, HANDLE ) }
////////////////////////////////////////////////////////////////////////////////////////
-// GetIcon - loads an icon for the contact list
-
-HICON __cdecl CIrcProto::GetIcon( int iconIndex )
-{
- if (LOWORD(iconIndex) == PLI_PROTOCOL)
- {
- if (iconIndex & PLIF_ICOLIBHANDLE)
- return (HICON)GetIconHandle(IDI_MAIN);
-
- bool big = (iconIndex & PLIF_SMALL) == 0;
- HICON hIcon = LoadIconEx(IDI_MAIN, big);
-
- if (iconIndex & PLIF_ICOLIB)
- return hIcon;
-
- HICON hIcon2 = CopyIcon(hIcon);
- ReleaseIconEx(hIcon);
- return hIcon2;
- }
- return NULL;
-}
-
-////////////////////////////////////////////////////////////////////////////////////////
// GetInfo - retrieves a contact info
int __cdecl CIrcProto::GetInfo( HANDLE, int )
@@ -605,7 +580,7 @@ void __cdecl CIrcProto::AckBasicSearch( void* param ) HANDLE __cdecl CIrcProto::SearchBasic( const PROTOCHAR* szId )
{
if ( szId ) {
- if (m_iStatus != ID_STATUS_OFFLINE && m_iStatus != ID_STATUS_CONNECTING &&
+ if (m_iStatus != ID_STATUS_OFFLINE && m_iStatus != ID_STATUS_CONNECTING &&
szId && szId[0] && !IsChannel(szId)) {
AckBasicSearchParam* param = new AckBasicSearchParam;
lstrcpyn( param->buf, szId, 50 );
|