summaryrefslogtreecommitdiff
path: root/protocols/VKontakte/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-04-21 12:33:31 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-04-21 12:33:31 +0300
commitca5001026a94f702c4012c5e8d2093ad3f51c1fa (patch)
tree554ad80633528d530057fc61035b15f901860ed2 /protocols/VKontakte/src
parente0799755b3966d1d6d8275ee5127242ec029a4e6 (diff)
code cleaning:
- in conformance to C++'11 rules, we don't declare a method as virtual if it's declared as override; - cause this code isn't visible in Pascal anymore, there's no need to use __cdecl calling convention for virtual methods; - since PROTO_INTERFACE is a regular C++ class, there's no need to use old style service declarations for virtual methods like OnModulesLoaded / OnShutdown
Diffstat (limited to 'protocols/VKontakte/src')
-rw-r--r--protocols/VKontakte/src/vk_proto.cpp21
-rw-r--r--protocols/VKontakte/src/vk_proto.h33
2 files changed, 21 insertions, 33 deletions
diff --git a/protocols/VKontakte/src/vk_proto.cpp b/protocols/VKontakte/src/vk_proto.cpp
index 867329bdec..eaf507aabd 100644
--- a/protocols/VKontakte/src/vk_proto.cpp
+++ b/protocols/VKontakte/src/vk_proto.cpp
@@ -17,11 +17,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "stdafx.h"
-static int sttCompareProtocols(const CVkProto *p1, const CVkProto *p2)
-{
- return mir_wstrcmp(p1->m_tszUserName, p2->m_tszUserName);
-}
-
static int sttCompareAsyncHttpRequest(const AsyncHttpRequest *p1, const AsyncHttpRequest *p2)
{
if (p1->m_priority == p2->m_priority)
@@ -92,7 +87,7 @@ CVkProto::~CVkProto()
Popup_UnregisterClass(m_hPopupClassNotification);
}
-int CVkProto::OnModulesLoaded(WPARAM, LPARAM)
+void CVkProto::OnModulesLoaded()
{
Clist_GroupCreate(0, m_vkOptions.pwszDefaultGroup);
@@ -118,7 +113,6 @@ int CVkProto::OnModulesLoaded(WPARAM, LPARAM)
InitPopups();
InitMenus();
InitDBCustomEvents();
- return 0;
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -483,18 +477,17 @@ void CVkProto::InitDBCustomEvents()
//////////////////////////////////////////////////////////////////////////////
-int CVkProto::OnPreShutdown(WPARAM, LPARAM)
+void CVkProto::OnShutdown()
{
debugLogA("CVkProto::OnPreShutdown");
m_bTerminated = true;
SetEvent(m_evRequestsQueue);
- return 0;
}
//////////////////////////////////////////////////////////////////////////////
-DWORD_PTR CVkProto::GetCaps(int type, MCONTACT)
+INT_PTR CVkProto::GetCaps(int type, MCONTACT)
{
switch (type) {
case PFLAGNUM_1:
@@ -518,7 +511,7 @@ DWORD_PTR CVkProto::GetCaps(int type, MCONTACT)
return 4096;
case PFLAG_UNIQUEIDTEXT:
- return (DWORD_PTR)"VKontakte ID";
+ return (INT_PTR)"VKontakte ID";
}
return 0;
}
@@ -528,12 +521,6 @@ DWORD_PTR CVkProto::GetCaps(int type, MCONTACT)
int CVkProto::OnEvent(PROTOEVENTTYPE event, WPARAM wParam, LPARAM lParam)
{
switch (event) {
- case EV_PROTO_ONLOAD:
- return OnModulesLoaded(wParam, lParam);
-
- case EV_PROTO_ONEXIT:
- return OnPreShutdown(wParam, lParam);
-
case EV_PROTO_ONCONTACTDELETED:
return OnContactDeleted(wParam, lParam);
}
diff --git a/protocols/VKontakte/src/vk_proto.h b/protocols/VKontakte/src/vk_proto.h
index 5c050cf2a4..50e5924afe 100644
--- a/protocols/VKontakte/src/vk_proto.h
+++ b/protocols/VKontakte/src/vk_proto.h
@@ -52,26 +52,27 @@ struct CVkProto : public PROTO<CVkProto>
// PROTO_INTERFACE
//====================================================================================
- virtual MCONTACT __cdecl AddToList(int flags, PROTOSEARCHRESULT *psr);
- virtual int __cdecl Authorize(MEVENT hDbEvent);
- virtual int __cdecl AuthDeny(MEVENT hDbEvent, const wchar_t *szReason);
- virtual int __cdecl AuthRequest(MCONTACT hContact, const wchar_t *szMessage);
- virtual DWORD_PTR __cdecl GetCaps(int type, MCONTACT hContact = 0);
- virtual int __cdecl GetInfo(MCONTACT hContact, int infoType);
- virtual HANDLE __cdecl SearchBasic(const wchar_t *id);
- virtual HANDLE __cdecl SearchByEmail(const wchar_t *email);
- virtual HANDLE __cdecl SearchByName(const wchar_t *nick, const wchar_t *firstName, const wchar_t *lastName);
- virtual int __cdecl SendMsg(MCONTACT hContact, int flags, const char *msg);
- virtual HANDLE __cdecl SendFile(MCONTACT hContact, const wchar_t *szDescription, wchar_t **ppszFiles);
- virtual int __cdecl SetStatus(int iNewStatus);
- virtual int __cdecl UserIsTyping(MCONTACT hContact, int type);
- virtual int __cdecl OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam);
+ MCONTACT AddToList(int flags, PROTOSEARCHRESULT *psr) override;
+ int Authorize(MEVENT hDbEvent) override;
+ int AuthDeny(MEVENT hDbEvent, const wchar_t *szReason) override;
+ int AuthRequest(MCONTACT hContact, const wchar_t *szMessage) override;
+ INT_PTR GetCaps(int type, MCONTACT hContact = 0) override;
+ int GetInfo(MCONTACT hContact, int infoType) override;
+ HANDLE SearchBasic(const wchar_t *id) override;
+ HANDLE SearchByEmail(const wchar_t *email) override;
+ HANDLE SearchByName(const wchar_t *nick, const wchar_t *firstName, const wchar_t *lastName) override;
+ int SendMsg(MCONTACT hContact, int flags, const char *msg) override;
+ HANDLE SendFile(MCONTACT hContact, const wchar_t *szDescription, wchar_t **ppszFiles) override;
+ int SetStatus(int iNewStatus) override;
+ int UserIsTyping(MCONTACT hContact, int type) override;
+
+ int OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam) override;
+ void OnModulesLoaded() override;
+ void OnShutdown() override;
//==== Events ========================================================================
- int __cdecl OnModulesLoaded(WPARAM, LPARAM);
int __cdecl OnOptionsInit(WPARAM, LPARAM);
- int __cdecl OnPreShutdown(WPARAM, LPARAM);
int __cdecl OnContactDeleted(WPARAM, LPARAM);
void OnOAuthAuthorize(NETLIBHTTPREQUEST*, AsyncHttpRequest*);
void OnReceiveAvatar(NETLIBHTTPREQUEST*, AsyncHttpRequest*);