diff options
| author | George Hazan <ghazan@miranda.im> | 2018-04-21 12:33:31 +0300 |
|---|---|---|
| committer | George Hazan <ghazan@miranda.im> | 2018-04-21 12:33:31 +0300 |
| commit | ca5001026a94f702c4012c5e8d2093ad3f51c1fa (patch) | |
| tree | 554ad80633528d530057fc61035b15f901860ed2 /plugins/CloudFile/src/menus.cpp | |
| parent | e0799755b3966d1d6d8275ee5127242ec029a4e6 (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 'plugins/CloudFile/src/menus.cpp')
| -rw-r--r-- | plugins/CloudFile/src/menus.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/plugins/CloudFile/src/menus.cpp b/plugins/CloudFile/src/menus.cpp index c0ed61285b..fed19569f6 100644 --- a/plugins/CloudFile/src/menus.cpp +++ b/plugins/CloudFile/src/menus.cpp @@ -30,23 +30,24 @@ void InitializeMenus() hContactMenu = Menu_AddContactMenuItem(&mi); } -void AddServiceMenuItem(const CCloudService *service) +void CCloudService::OnModulesLoaded() { CMenuItem mi; mi.root = hContactMenu; - CMStringA serviceName(FORMAT, "/%s/Upload", service->GetAccountName()); + CMStringA serviceName(FORMAT, "/%s/Upload", GetAccountName()); mi.pszService = serviceName.GetBuffer(); - mi.hLangpack = service->GetId(); + mi.hLangpack = GetId(); mi.flags = CMIF_SYSTEM | CMIF_UNICODE; - mi.name.w = (wchar_t*)service->GetUserName(); + mi.name.w = (wchar_t*)GetUserName(); mi.position = Services.getCount(); - mi.hIcolibItem = GetIconHandle(service->GetIconId()); + mi.hIcolibItem = GetIconHandle(GetIconId()); Menu_AddContactMenuItem(&mi); - CreateServiceFunctionObj(mi.pszService, UploadMenuCommand, (void*)service); + + CreateServiceFunctionObj(mi.pszService, UploadMenuCommand, this); } int OnPrebuildContactMenu(WPARAM hContact, LPARAM) { Menu_ShowItem(hContactMenu, CanSendToContact(hContact)); return 0; -}
\ No newline at end of file +} |
