summaryrefslogtreecommitdiff
path: root/plugins/NotifyAnything/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-05-20 15:08:48 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-05-20 15:08:48 +0300
commit8a74e7495ce5ad39de4f5c25121a84d35df90c36 (patch)
tree03e5b4870f09a3163306740c2eebee47bc15b042 /plugins/NotifyAnything/src
parentc5bf7d6123dd1c3b82ccb8fdb1b068077e9d56d4 (diff)
CMPlugin to receive a reference to PLUGININFOEX
Diffstat (limited to 'plugins/NotifyAnything/src')
-rw-r--r--plugins/NotifyAnything/src/main.cpp10
-rw-r--r--plugins/NotifyAnything/src/options.cpp36
-rw-r--r--plugins/NotifyAnything/src/stdafx.h6
3 files changed, 27 insertions, 25 deletions
diff --git a/plugins/NotifyAnything/src/main.cpp b/plugins/NotifyAnything/src/main.cpp
index 4b05c673ad..893ddc3bd1 100644
--- a/plugins/NotifyAnything/src/main.cpp
+++ b/plugins/NotifyAnything/src/main.cpp
@@ -29,7 +29,7 @@ int &hLangpack(g_plugin.m_hLang);
/////////////////////////////////////////////////////////////////////////////////////////
-PLUGININFOEX pluginInfo =
+PLUGININFOEX pluginInfoEx =
{
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
@@ -43,9 +43,13 @@ PLUGININFOEX pluginInfo =
{ 0xe92874ec, 0x594a, 0x4a2f, { 0xbd, 0xed, 0xc0, 0xbe, 0x8b, 0x5a, 0x45, 0xd1 } }
};
+CMPlugin::CMPlugin() :
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
+{}
+
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
- return &pluginInfo;
+ return &pluginInfoEx;
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -970,7 +974,7 @@ void stop_threads()
extern "C" int __declspec(dllexport) Load()
{
g_firstrun = true;
- mir_getLP(&pluginInfo);
+ mir_getLP(&pluginInfoEx);
wchar_t buf[MAX_PATH + 1];
mir_wstrcpy(buf, L".");
diff --git a/plugins/NotifyAnything/src/options.cpp b/plugins/NotifyAnything/src/options.cpp
index 41e983dcba..d468ff11bc 100644
--- a/plugins/NotifyAnything/src/options.cpp
+++ b/plugins/NotifyAnything/src/options.cpp
@@ -134,34 +134,34 @@ INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara
void save_settings()
{
- db_set_b(NULL, PlugName, "local_only", g_settings.local_only);
- db_set_b(NULL, PlugName, "debug_messages", g_settings.debug_messages);
- db_set_b(NULL, PlugName, "log_to_file", g_settings.log_to_file);
- db_set_b(NULL, PlugName, "beep", g_settings.sound);
- db_set_b(NULL, PlugName, "use_pcspeaker", g_settings.use_pcspeaker);
- db_set_b(NULL, PlugName, "allow_execute", g_settings.allow_execute);
- db_set_dw(NULL, PlugName, "port", g_settings.port);
- db_set_ws(NULL, PlugName, "password", g_settings.password.c_str());
- db_set_ws(NULL, PlugName, "log_filename", g_settings.log_filename.c_str());
+ db_set_b(NULL, MODULENAME, "local_only", g_settings.local_only);
+ db_set_b(NULL, MODULENAME, "debug_messages", g_settings.debug_messages);
+ db_set_b(NULL, MODULENAME, "log_to_file", g_settings.log_to_file);
+ db_set_b(NULL, MODULENAME, "beep", g_settings.sound);
+ db_set_b(NULL, MODULENAME, "use_pcspeaker", g_settings.use_pcspeaker);
+ db_set_b(NULL, MODULENAME, "allow_execute", g_settings.allow_execute);
+ db_set_dw(NULL, MODULENAME, "port", g_settings.port);
+ db_set_ws(NULL, MODULENAME, "password", g_settings.password.c_str());
+ db_set_ws(NULL, MODULENAME, "log_filename", g_settings.log_filename.c_str());
}
void load_settings()
{
- g_settings.local_only = db_get_b(NULL, PlugName, "local_only", 1) != 0;
- g_settings.debug_messages = db_get_b(NULL, PlugName, "debug_messages", 0) != 0;
- g_settings.log_to_file = db_get_b(NULL, PlugName, "log_to_file", 0) != 0;
- g_settings.sound = NASettings::sound_t(db_get_b(NULL, PlugName, "beep", g_settings.request));
- g_settings.use_pcspeaker = db_get_b(NULL, PlugName, "use_pcspeaker", 0) != 0;
- g_settings.allow_execute = db_get_b(NULL, PlugName, "allow_execute", 0) != 0;
- g_settings.port = db_get_dw(NULL, PlugName, "port", 12001);
+ g_settings.local_only = db_get_b(NULL, MODULENAME, "local_only", 1) != 0;
+ g_settings.debug_messages = db_get_b(NULL, MODULENAME, "debug_messages", 0) != 0;
+ g_settings.log_to_file = db_get_b(NULL, MODULENAME, "log_to_file", 0) != 0;
+ g_settings.sound = NASettings::sound_t(db_get_b(NULL, MODULENAME, "beep", g_settings.request));
+ g_settings.use_pcspeaker = db_get_b(NULL, MODULENAME, "use_pcspeaker", 0) != 0;
+ g_settings.allow_execute = db_get_b(NULL, MODULENAME, "allow_execute", 0) != 0;
+ g_settings.port = db_get_dw(NULL, MODULENAME, "port", 12001);
DBVARIANT dbv;
- if (!db_get_ws(NULL, PlugName, "password", &dbv)) {
+ if (!db_get_ws(NULL, MODULENAME, "password", &dbv)) {
g_settings.password = dbv.ptszVal;
db_free(&dbv);
}
- if (!db_get_ws(NULL, PlugName, "log_filename", &dbv)) {
+ if (!db_get_ws(NULL, MODULENAME, "log_filename", &dbv)) {
g_settings.log_filename = dbv.ptszVal;
db_free(&dbv);
}
diff --git a/plugins/NotifyAnything/src/stdafx.h b/plugins/NotifyAnything/src/stdafx.h
index 1eaf2a7da5..940b5d379f 100644
--- a/plugins/NotifyAnything/src/stdafx.h
+++ b/plugins/NotifyAnything/src/stdafx.h
@@ -21,13 +21,11 @@
#include "resource.h"
#include "version.h"
-const char PlugName[] = "NotifyAnything";
+#define MODULENAME "NotifyAnything"
struct CMPlugin : public PLUGIN<CMPlugin>
{
- CMPlugin() :
- PLUGIN<CMPlugin>(PlugName)
- {}
+ CMPlugin();
};
//---------------------------