summaryrefslogtreecommitdiff
path: root/plugins/Weather/src
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Weather/src')
-rw-r--r--plugins/Weather/src/stdafx.h1
-rw-r--r--plugins/Weather/src/weather.cpp20
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;