diff options
author | George Hazan <ghazan@miranda.im> | 2018-03-28 14:29:31 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-03-28 14:29:31 +0300 |
commit | a905c9c3f92fd54f37a5466649ac378db69e7cb0 (patch) | |
tree | 87a60dadfbf9fd8d916ea9100c26b6e314293242 /plugins/Weather/src | |
parent | d75fed3bfc9c252f5d20b889e0bec95fb0a4527e (diff) |
all protocols rewritten to CMPluginBase
Diffstat (limited to 'plugins/Weather/src')
-rw-r--r-- | plugins/Weather/src/stdafx.h | 1 | ||||
-rw-r--r-- | plugins/Weather/src/weather.cpp | 20 |
2 files changed, 14 insertions, 7 deletions
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 <http://www.gnu.org/licenses/>. #include <m_popup.h>
#include <win2k.h>
#include <m_acc.h>
+#include <m_plugin.h>
#include <m_weather.h>
#include <m_toptoolbar.h>
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;
|