From 8a74e7495ce5ad39de4f5c25121a84d35df90c36 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 20 May 2018 15:08:48 +0300 Subject: CMPlugin to receive a reference to PLUGININFOEX --- plugins/Watrack_MPD/src/init.cpp | 16 ++++++++++------ plugins/Watrack_MPD/src/options.cpp | 12 ++++++------ plugins/Watrack_MPD/src/stdafx.h | 6 ++---- 3 files changed, 18 insertions(+), 16 deletions(-) (limited to 'plugins/Watrack_MPD/src') diff --git a/plugins/Watrack_MPD/src/init.cpp b/plugins/Watrack_MPD/src/init.cpp index 7de20e5228..cf690bb4d7 100755 --- a/plugins/Watrack_MPD/src/init.cpp +++ b/plugins/Watrack_MPD/src/init.cpp @@ -26,7 +26,7 @@ HNETLIBUSER ghNetlibUser; ///////////////////////////////////////////////////////////////////////////////////////// -PLUGININFOEX pluginInfo = +PLUGININFOEX pluginInfoEx = { sizeof(PLUGININFOEX), __PLUGIN_NAME, @@ -40,9 +40,13 @@ PLUGININFOEX pluginInfo = { 0x692e87d0, 0x6c71, 0x4cdc, {0x9e, 0x36, 0x2b, 0x2d, 0x69, 0xfb, 0xdc, 0x4c }} }; +CMPlugin::CMPlugin() : + PLUGIN(MODULENAME, pluginInfoEx) +{} + extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD) { - return &pluginInfo; + return &pluginInfoEx; } ///////////////////////////////////////////////////////////////////////////////////////// @@ -55,9 +59,9 @@ static int OnModulesLoaded(WPARAM, LPARAM) nlu.szSettingsModule = __PLUGIN_NAME; ghNetlibUser = Netlib_RegisterUser(&nlu); - gbPort = db_get_w(NULL, szModuleName, "Port", 6600); - gbHost = UniGetContactSettingUtf(NULL, szModuleName, "Server", L"127.0.0.1"); - gbPassword = UniGetContactSettingUtf(NULL, szModuleName, "Password", L""); + gbPort = db_get_w(NULL, MODULENAME, "Port", 6600); + gbHost = UniGetContactSettingUtf(NULL, MODULENAME, "Server", L"127.0.0.1"); + gbPassword = UniGetContactSettingUtf(NULL, MODULENAME, "Password", L""); if (ServiceExists(MS_WAT_PLAYER)) bWatrackService = TRUE; @@ -68,7 +72,7 @@ static int OnModulesLoaded(WPARAM, LPARAM) extern "C" __declspec(dllexport) int Load() { - mir_getLP(&pluginInfo); + mir_getLP(&pluginInfoEx); HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded); HookEvent(ME_OPT_INITIALISE, WaMpdOptInit); diff --git a/plugins/Watrack_MPD/src/options.cpp b/plugins/Watrack_MPD/src/options.cpp index 1a65da6ba9..a726ef26d2 100755 --- a/plugins/Watrack_MPD/src/options.cpp +++ b/plugins/Watrack_MPD/src/options.cpp @@ -24,21 +24,21 @@ public: {} virtual void OnInitDialog() override { - edit_PORT.SetInt(db_get_w(NULL, szModuleName, "Port", 6600)); - wchar_t *tmp = UniGetContactSettingUtf(NULL, szModuleName, "Server", L"127.0.0.1"); + edit_PORT.SetInt(db_get_w(NULL, MODULENAME, "Port", 6600)); + wchar_t *tmp = UniGetContactSettingUtf(NULL, MODULENAME, "Server", L"127.0.0.1"); edit_SERVER.SetText(tmp); mir_free(tmp); - tmp = UniGetContactSettingUtf(NULL, szModuleName, "Password", L""); + tmp = UniGetContactSettingUtf(NULL, MODULENAME, "Password", L""); edit_PASSWORD.SetText(tmp); mir_free(tmp); } virtual void OnApply() override { - db_set_w(NULL, szModuleName, "Port", (WORD)edit_PORT.GetInt()); + db_set_w(NULL, MODULENAME, "Port", (WORD)edit_PORT.GetInt()); gbPort = edit_PORT.GetInt(); - db_set_ws(NULL, szModuleName, "Server", edit_SERVER.GetText()); + db_set_ws(NULL, MODULENAME, "Server", edit_SERVER.GetText()); mir_wstrcpy(gbHost, edit_SERVER.GetText()); - db_set_ws(NULL, szModuleName, "Password", edit_PASSWORD.GetText()); + db_set_ws(NULL, MODULENAME, "Password", edit_PASSWORD.GetText()); mir_wstrcpy(gbPassword, edit_PASSWORD.GetText()); } private: diff --git a/plugins/Watrack_MPD/src/stdafx.h b/plugins/Watrack_MPD/src/stdafx.h index 161ccb2209..7342704828 100755 --- a/plugins/Watrack_MPD/src/stdafx.h +++ b/plugins/Watrack_MPD/src/stdafx.h @@ -32,13 +32,11 @@ #include "utilities.h" #include "version.h" -#define szModuleName "Watrack_MPD" +#define MODULENAME "Watrack_MPD" struct CMPlugin : public PLUGIN { - CMPlugin() : - PLUGIN(szModuleName) - {} + CMPlugin(); }; extern HNETLIBUSER ghNetlibUser; -- cgit v1.2.3