From a905c9c3f92fd54f37a5466649ac378db69e7cb0 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 28 Mar 2018 14:29:31 +0300 Subject: all protocols rewritten to CMPluginBase --- plugins/Weather/src/stdafx.h | 1 + plugins/Weather/src/weather.cpp | 20 +++++++++++++------- 2 files changed, 14 insertions(+), 7 deletions(-) (limited to 'plugins/Weather/src') diff --git a/plugins/Weather/src/stdafx.h b/plugins/Weather/src/stdafx.h index d9ec87c558..17eca030b2 100644 --- a/plugins/Weather/src/stdafx.h +++ b/plugins/Weather/src/stdafx.h @@ -54,6 +54,7 @@ along with this program. If not, see . #include #include #include +#include #include #include diff --git a/plugins/Weather/src/weather.cpp b/plugins/Weather/src/weather.cpp index 8ea8f6605f..1a01b18802 100644 --- a/plugins/Weather/src/weather.cpp +++ b/plugins/Weather/src/weather.cpp @@ -216,13 +216,6 @@ extern "C" int __declspec(dllexport) Load(void) hUpdateMutex = CreateMutex(nullptr, FALSE, nullptr); - // register weather protocol - PROTOCOLDESCRIPTOR pd = { 0 }; - pd.cbSize = sizeof(pd); - pd.szName = WEATHERPROTONAME; - pd.type = (opt.NoProtoCondition) ? PROTOTYPE_VIRTUAL : PROTOTYPE_PROTOCOL; - Proto_RegisterModule(&pd); - // initialize weather protocol services InitServices(); @@ -238,3 +231,16 @@ extern "C" int __declspec(dllexport) Load(void) SetWindowLongPtr(hPopupWindow, GWLP_WNDPROC, (LONG_PTR)PopupWndProc); return 0; } + +///////////////////////////////////////////////////////////////////////////////////////// + +struct CMPlugin : public CMPluginBase +{ + CMPlugin() : + CMPluginBase(WEATHERPROTONAME) + { + opt.NoProtoCondition = db_get_b(NULL, WEATHERPROTONAME, "NoStatus", true); + RegisterProtocol((opt.NoProtoCondition) ? PROTOTYPE_VIRTUAL : PROTOTYPE_PROTOCOL); + } +} + g_plugin; -- cgit v1.2.3