From 64e3214c2222543350f51b517a6b75b6b02b81cf Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 14 Nov 2018 18:23:04 +0300 Subject: unused MODULENAME macros removed --- plugins/AVS/src/main.cpp | 2 +- plugins/AVS/src/stdafx.h | 1 - plugins/AsSingleWindow/src/AsSingleWindow.cpp | 2 +- plugins/AsSingleWindow/src/Options.h | 2 - plugins/Boltun/src/boltun.cpp | 2 +- plugins/Boltun/src/stdafx.h | 2 - plugins/BuddyExpectator/src/BuddyExpectator.cpp | 12 +-- plugins/BuddyExpectator/src/options.cpp | 8 +- plugins/BuddyExpectator/src/stdafx.h | 2 - plugins/Exchange/src/exchange.cpp | 2 +- plugins/Exchange/src/stdafx.h | 2 - plugins/Folders/src/folders.cpp | 2 +- plugins/Folders/src/stdafx.h | 2 - plugins/HwHotKeys/src/HwHotKeys_DllMain.cpp | 2 +- plugins/HwHotKeys/src/version.h | 2 - plugins/IEHistory/src/IEHistory.cpp | 2 +- plugins/IEHistory/src/stdafx.h | 2 - plugins/KeyboardNotify/src/constants.h | 1 - plugins/KeyboardNotify/src/main.cpp | 2 +- plugins/MagneticWindows/src/MagneticWindows.cpp | 2 +- plugins/MagneticWindows/src/stdafx.h | 2 - plugins/MobileState/src/main.cpp | 2 +- plugins/MobileState/src/stdafx.h | 2 - plugins/Rate/src/main.cpp | 2 +- plugins/Rate/src/stdafx.h | 2 - plugins/SkypeStatusChange/src/main.cpp | 2 +- plugins/SkypeStatusChange/src/stdafx.h | 100 ++++++++++++------------ plugins/SplashScreen/src/main.cpp | 2 +- plugins/SplashScreen/src/stdafx.h | 2 +- plugins/StartupSilence/src/main.cpp | 44 +++++------ plugins/mTextControl/src/main.cpp | 2 +- plugins/mTextControl/src/stdafx.h | 3 - plugins/mTextControl/src/textcontrol.cpp | 9 +-- plugins/wbOSD/src/main.cpp | 2 +- plugins/wbOSD/src/stdafx.h | 2 - 35 files changed, 100 insertions(+), 132 deletions(-) (limited to 'plugins') diff --git a/plugins/AVS/src/main.cpp b/plugins/AVS/src/main.cpp index 057f69339c..4f3d79647a 100644 --- a/plugins/AVS/src/main.cpp +++ b/plugins/AVS/src/main.cpp @@ -57,7 +57,7 @@ static PLUGININFOEX pluginInfoEx = }; CMPlugin::CMPlugin() : - PLUGIN(MODULENAME, pluginInfoEx) + PLUGIN("AVS_Settings", pluginInfoEx) {} ///////////////////////////////////////////////////////////////////////////////////////// diff --git a/plugins/AVS/src/stdafx.h b/plugins/AVS/src/stdafx.h index 0caf8837ac..21385e074e 100644 --- a/plugins/AVS/src/stdafx.h +++ b/plugins/AVS/src/stdafx.h @@ -57,7 +57,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define SHVIEW_THUMBNAIL 0x702D #endif -#define MODULENAME "AVS_Settings" // db settings module path #define PPICT_MODULE "AVS_ProtoPics" // protocol pictures are saved here struct CMPlugin : public PLUGIN diff --git a/plugins/AsSingleWindow/src/AsSingleWindow.cpp b/plugins/AsSingleWindow/src/AsSingleWindow.cpp index 21d5f4fc8b..f34e862cef 100644 --- a/plugins/AsSingleWindow/src/AsSingleWindow.cpp +++ b/plugins/AsSingleWindow/src/AsSingleWindow.cpp @@ -23,7 +23,7 @@ PLUGININFOEX pluginInfoEx = { }; CMPlugin::CMPlugin() : - PLUGIN(MODULENAME, pluginInfoEx) + PLUGIN("AsSingleWindow", pluginInfoEx) {} ///////////////////////////////////////////////////////////////////////////////////////// diff --git a/plugins/AsSingleWindow/src/Options.h b/plugins/AsSingleWindow/src/Options.h index 5a2829dc72..cdbe9ba449 100644 --- a/plugins/AsSingleWindow/src/Options.h +++ b/plugins/AsSingleWindow/src/Options.h @@ -1,7 +1,5 @@ #pragma once -#define MODULENAME "AsSingleWindow" - int InitOptions(WPARAM wParam, LPARAM lParam); INT_PTR CALLBACK cbOptionsDialog(HWND, UINT, WPARAM, LPARAM); diff --git a/plugins/Boltun/src/boltun.cpp b/plugins/Boltun/src/boltun.cpp index 1a76531433..49296ac118 100644 --- a/plugins/Boltun/src/boltun.cpp +++ b/plugins/Boltun/src/boltun.cpp @@ -56,7 +56,7 @@ PLUGININFOEX pluginInfoEx = }; CMPlugin::CMPlugin() : - PLUGIN(BOLTUN_KEY, pluginInfoEx) + PLUGIN("Boltun", pluginInfoEx) {} ///////////////////////////////////////////////////////////////////////////////////////// diff --git a/plugins/Boltun/src/stdafx.h b/plugins/Boltun/src/stdafx.h index 8af454330c..3ac662479c 100644 --- a/plugins/Boltun/src/stdafx.h +++ b/plugins/Boltun/src/stdafx.h @@ -49,8 +49,6 @@ #include "Engine/MyCodeCvt.h" #include "Engine/Mind.h" -#define BOLTUN_KEY "Boltun" - struct CMPlugin : public PLUGIN { CMPlugin(); diff --git a/plugins/BuddyExpectator/src/BuddyExpectator.cpp b/plugins/BuddyExpectator/src/BuddyExpectator.cpp index 2760f7c387..9baeda0297 100644 --- a/plugins/BuddyExpectator/src/BuddyExpectator.cpp +++ b/plugins/BuddyExpectator/src/BuddyExpectator.cpp @@ -61,7 +61,7 @@ PLUGININFOEX pluginInfoEx = { }; CMPlugin::CMPlugin() : - PLUGIN(MODULENAME, pluginInfoEx) + PLUGIN("BuddyExpectator", pluginInfoEx) {} ///////////////////////////////////////////////////////////////////////////////////////// @@ -106,7 +106,7 @@ LRESULT CALLBACK HidePopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM break; case WM_CONTEXTMENU: - db_set_b(PUGetContact(hWnd), MODULENAME, "NeverHide", 1); + g_plugin.setByte(PUGetContact(hWnd), "NeverHide", 1); PUDeletePopup(hWnd); break; @@ -116,7 +116,7 @@ LRESULT CALLBACK HidePopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM PUDeletePopup(hWnd); } if (wParam == 3) { - db_set_b(PUGetContact(hWnd), MODULENAME, "NeverHide", 1); + g_plugin.setByte(PUGetContact(hWnd), "NeverHide", 1); PUDeletePopup(hWnd); } break; @@ -133,8 +133,8 @@ LRESULT CALLBACK MissYouPopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPA case WM_COMMAND: if (HIWORD(wParam) == STN_CLICKED) { CallServiceSync("BuddyExpectator/actionMissYou", (WPARAM)PUGetContact(hWnd), 0); - if (!db_get_b(PUGetContact(hWnd), MODULENAME, "MissYouNotifyAlways", 0)) { - db_set_b(PUGetContact(hWnd), MODULENAME, "MissYou", 0); + if (!g_plugin.getByte(PUGetContact(hWnd), "MissYouNotifyAlways", 0)) { + g_plugin.setByte(PUGetContact(hWnd), "MissYou", 0); ExtraIcon_Clear(hExtraIcon, PUGetContact(hWnd)); } PUDeletePopup(hWnd); @@ -147,7 +147,7 @@ LRESULT CALLBACK MissYouPopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPA case UM_POPUPACTION: if (wParam == 1) { - db_set_b(PUGetContact(hWnd), MODULENAME, "MissYou", 0); + g_plugin.setByte(PUGetContact(hWnd), "MissYou", 0); ExtraIcon_Clear(hExtraIcon, PUGetContact(hWnd)); PUDeletePopup(hWnd); } diff --git a/plugins/BuddyExpectator/src/options.cpp b/plugins/BuddyExpectator/src/options.cpp index 4655dcfef6..6296fd7b34 100644 --- a/plugins/BuddyExpectator/src/options.cpp +++ b/plugins/BuddyExpectator/src/options.cpp @@ -475,7 +475,7 @@ INT_PTR CALLBACK UserinfoDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lpar SetDlgItemText(hdlg, IDC_EDIT_LASTINPUT, tmpBuf); } - unsigned int AbsencePeriod = db_get_dw((MCONTACT)lparam, MODULENAME, "iAbsencePeriod", options.iAbsencePeriod); + unsigned int AbsencePeriod = g_plugin.getDword(lparam, "iAbsencePeriod", options.iAbsencePeriod); SendDlgItemMessage(hdlg, IDC_SPINABSENCE, UDM_SETRANGE, 0, MAKELONG(999, 1)); SetDlgItemInt(hdlg, IDC_EDITABSENCE, AbsencePeriod, FALSE); @@ -485,9 +485,9 @@ INT_PTR CALLBACK UserinfoDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lpar else SetDlgItemText(hdlg, IDC_EDIT_WILLNOTICE, L""); - CheckDlgButton(hdlg, IDC_CHECK_MISSYOU, db_get_b((MCONTACT)lparam, MODULENAME, "MissYou", 0) ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hdlg, IDC_CHECK_NOTIFYALWAYS, db_get_b((MCONTACT)lparam, MODULENAME, "MissYouNotifyAlways", 0) ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hdlg, IDC_CHECK_NEVERHIDE, db_get_b((MCONTACT)lparam, MODULENAME, "NeverHide", 0) ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hdlg, IDC_CHECK_MISSYOU, g_plugin.getByte(lparam, "MissYou") ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hdlg, IDC_CHECK_NOTIFYALWAYS, g_plugin.getByte(lparam, "MissYouNotifyAlways") ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hdlg, IDC_CHECK_NEVERHIDE, g_plugin.getByte(lparam, "NeverHide") ? BST_CHECKED : BST_UNCHECKED); TranslateDialogDefault(hdlg); return TRUE; diff --git a/plugins/BuddyExpectator/src/stdafx.h b/plugins/BuddyExpectator/src/stdafx.h index 798492ec0c..4604eb43d1 100644 --- a/plugins/BuddyExpectator/src/stdafx.h +++ b/plugins/BuddyExpectator/src/stdafx.h @@ -45,8 +45,6 @@ #include "options.h" #include "version.h" -#define MODULENAME "BuddyExpectator" - struct CMPlugin : public PLUGIN { CMPlugin(); diff --git a/plugins/Exchange/src/exchange.cpp b/plugins/Exchange/src/exchange.cpp index 772faf237c..73ae8d175f 100644 --- a/plugins/Exchange/src/exchange.cpp +++ b/plugins/Exchange/src/exchange.cpp @@ -43,7 +43,7 @@ PLUGININFOEX pluginInfoEx = }; CMPlugin::CMPlugin() : - PLUGIN(MODULENAME, pluginInfoEx) + PLUGIN("ExchangeNotify", pluginInfoEx) {} ///////////////////////////////////////////////////////////////////////////////////////// diff --git a/plugins/Exchange/src/stdafx.h b/plugins/Exchange/src/stdafx.h index 67394ca4ce..152f680f18 100644 --- a/plugins/Exchange/src/stdafx.h +++ b/plugins/Exchange/src/stdafx.h @@ -48,8 +48,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "services.h" #include "hooked_events.h" -#define MODULENAME "ExchangeNotify" - extern HICON hiMailIcon; extern HWND hEmailsDlg; diff --git a/plugins/Folders/src/folders.cpp b/plugins/Folders/src/folders.cpp index cede3c264a..291f1e0cfe 100644 --- a/plugins/Folders/src/folders.cpp +++ b/plugins/Folders/src/folders.cpp @@ -40,7 +40,7 @@ PLUGININFOEX pluginInfoEx = { }; CMPlugin::CMPlugin() : - PLUGIN(MODULENAME, pluginInfoEx) + PLUGIN("Folders", pluginInfoEx) {} ///////////////////////////////////////////////////////////////////////////////////////// diff --git a/plugins/Folders/src/stdafx.h b/plugins/Folders/src/stdafx.h index 0bb2a74245..778d44d73a 100644 --- a/plugins/Folders/src/stdafx.h +++ b/plugins/Folders/src/stdafx.h @@ -54,8 +54,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define MS_FOLDERS_TEST_PLUGIN "Folders/Test/Plugin" -#define MODULENAME "Folders" - struct CMPlugin : public PLUGIN { CMPlugin(); diff --git a/plugins/HwHotKeys/src/HwHotKeys_DllMain.cpp b/plugins/HwHotKeys/src/HwHotKeys_DllMain.cpp index 0bba4387f7..a1fb302e8d 100644 --- a/plugins/HwHotKeys/src/HwHotKeys_DllMain.cpp +++ b/plugins/HwHotKeys/src/HwHotKeys_DllMain.cpp @@ -80,7 +80,7 @@ PLUGININFOEX pluginInfoEx = { }; CMPlugin::CMPlugin() : - PLUGIN(MODULENAME, pluginInfoEx) + PLUGIN("HwHotKeys", pluginInfoEx) {} // ============================================================================ diff --git a/plugins/HwHotKeys/src/version.h b/plugins/HwHotKeys/src/version.h index 39a5a9c977..4f35e52a1e 100644 --- a/plugins/HwHotKeys/src/version.h +++ b/plugins/HwHotKeys/src/version.h @@ -35,5 +35,3 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111 - 1307, USA. #define __AUTHORWEB "http://f2065.narod.ru/" // описание плагина в dll-fileinfo "CompanyName", описание плагина в миранде #define __COPYRIGHT "© 2010-18 Eugene f2065" // описание плагина в dll-fileinfo "LegalCopyright", описание плагина в миранде -#define MODULENAME "HwHotKeys" // имя раздела настроек плагина в БД миранды - diff --git a/plugins/IEHistory/src/IEHistory.cpp b/plugins/IEHistory/src/IEHistory.cpp index f8e5a290ee..442cbc95b2 100644 --- a/plugins/IEHistory/src/IEHistory.cpp +++ b/plugins/IEHistory/src/IEHistory.cpp @@ -46,7 +46,7 @@ PLUGININFOEX pluginInfoEx = { }; CMPlugin::CMPlugin() : - PLUGIN(MODULENAME, pluginInfoEx) + PLUGIN("IEHistory", pluginInfoEx) {} ///////////////////////////////////////////////////////////////////////////////////////// diff --git a/plugins/IEHistory/src/stdafx.h b/plugins/IEHistory/src/stdafx.h index 3d182815ff..8e69c67a8f 100644 --- a/plugins/IEHistory/src/stdafx.h +++ b/plugins/IEHistory/src/stdafx.h @@ -69,8 +69,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # define sntprintf snwprintf #endif -#define MODULENAME "IEHistory" - struct CMPlugin : public PLUGIN { CMPlugin(); diff --git a/plugins/KeyboardNotify/src/constants.h b/plugins/KeyboardNotify/src/constants.h index 61c6304906..d6637469bf 100644 --- a/plugins/KeyboardNotify/src/constants.h +++ b/plugins/KeyboardNotify/src/constants.h @@ -19,7 +19,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #pragma once // Settings values -#define MODULENAME "keybdnotify" #define FLASH_SAMETIME 0 #define FLASH_INTURN 1 #define FLASH_INSEQUENCE 2 diff --git a/plugins/KeyboardNotify/src/main.cpp b/plugins/KeyboardNotify/src/main.cpp index a551012d29..7c621d3073 100644 --- a/plugins/KeyboardNotify/src/main.cpp +++ b/plugins/KeyboardNotify/src/main.cpp @@ -101,7 +101,7 @@ PLUGININFOEX pluginInfoEx = }; CMPlugin::CMPlugin() : - PLUGIN(MODULENAME, pluginInfoEx) + PLUGIN("keybdnotify", pluginInfoEx) {} ///////////////////////////////////////////////////////////////////////////////////////// diff --git a/plugins/MagneticWindows/src/MagneticWindows.cpp b/plugins/MagneticWindows/src/MagneticWindows.cpp index ec9f3928e7..9256fee2b7 100644 --- a/plugins/MagneticWindows/src/MagneticWindows.cpp +++ b/plugins/MagneticWindows/src/MagneticWindows.cpp @@ -32,7 +32,7 @@ PLUGININFOEX pluginInfoEx = { }; CMPlugin::CMPlugin() : - PLUGIN(MODULENAME, pluginInfoEx) + PLUGIN("MagneticWindows", pluginInfoEx) {} /////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/plugins/MagneticWindows/src/stdafx.h b/plugins/MagneticWindows/src/stdafx.h index 1bc81267c0..f754dbbf1f 100644 --- a/plugins/MagneticWindows/src/stdafx.h +++ b/plugins/MagneticWindows/src/stdafx.h @@ -23,8 +23,6 @@ struct TWorkingVariables bool SnappedX, SnappedY; }; -#define MODULENAME "MagneticWindows" - struct CMPlugin : public PLUGIN { CMPlugin(); diff --git a/plugins/MobileState/src/main.cpp b/plugins/MobileState/src/main.cpp index ff9ef152d8..55b48463f2 100644 --- a/plugins/MobileState/src/main.cpp +++ b/plugins/MobileState/src/main.cpp @@ -44,7 +44,7 @@ PLUGININFOEX pluginInfoEx = { }; CMPlugin::CMPlugin() : - PLUGIN(MODULENAME, pluginInfoEx) + PLUGIN("MobileState", pluginInfoEx) {} ///////////////////////////////////////////////////////////////////////////////////////// diff --git a/plugins/MobileState/src/stdafx.h b/plugins/MobileState/src/stdafx.h index 38e126b481..1c2ca4b416 100644 --- a/plugins/MobileState/src/stdafx.h +++ b/plugins/MobileState/src/stdafx.h @@ -35,8 +35,6 @@ #include "version.h" #include "clients.h" -#define MODULENAME "MobileState" - struct CMPlugin : public PLUGIN { CMPlugin(); diff --git a/plugins/Rate/src/main.cpp b/plugins/Rate/src/main.cpp index 1c15d5f978..0508f37648 100644 --- a/plugins/Rate/src/main.cpp +++ b/plugins/Rate/src/main.cpp @@ -63,7 +63,7 @@ PLUGININFOEX pluginInfoEx = }; CMPlugin::CMPlugin() : - PLUGIN(MODULENAME, pluginInfoEx) + PLUGIN("Rate", pluginInfoEx) {} /////////////////////////////////////////////////////////////////////////////// diff --git a/plugins/Rate/src/stdafx.h b/plugins/Rate/src/stdafx.h index 9226bf1c7a..3523bdd1f9 100644 --- a/plugins/Rate/src/stdafx.h +++ b/plugins/Rate/src/stdafx.h @@ -28,5 +28,3 @@ #include "resource.h" #include "version.h" - -#define MODULENAME "Rate" diff --git a/plugins/SkypeStatusChange/src/main.cpp b/plugins/SkypeStatusChange/src/main.cpp index 9ddbc28fcd..1abb83ad54 100644 --- a/plugins/SkypeStatusChange/src/main.cpp +++ b/plugins/SkypeStatusChange/src/main.cpp @@ -33,7 +33,7 @@ static PLUGININFOEX pluginInfoEx = }; CMPlugin::CMPlugin() : - PLUGIN(MODULENAME, pluginInfoEx) + PLUGIN("Change Skype Status", pluginInfoEx) {} ///////////////////////////////////////////////////////////////////////////////////////// diff --git a/plugins/SkypeStatusChange/src/stdafx.h b/plugins/SkypeStatusChange/src/stdafx.h index d33c1cef9f..1aaead0247 100644 --- a/plugins/SkypeStatusChange/src/stdafx.h +++ b/plugins/SkypeStatusChange/src/stdafx.h @@ -15,8 +15,6 @@ #include #include -#define MODULENAME "Change Skype Status" - struct CMPlugin : public PLUGIN { CMPlugin(); @@ -28,35 +26,34 @@ class COptions { enum { - cssOnline = 0x00000001, - cssOffline = 0x00000002, - cssInvisible = 0x00000004, - cssShortAway = 0x00000008, - cssLongAway = 0x00000010, - cssLightDND = 0x00000020, - cssHeavyDND = 0x00000040, - cssFreeChart = 0x00000080, - cssOutToLunch = 0x00000100, - cssOnThePhone = 0x00000200, - cssIdle = 0x00000400, - cssAll = 0x80000000 + cssOnline = 0x00000001, + cssOffline = 0x00000002, + cssInvisible = 0x00000004, + cssShortAway = 0x00000008, + cssLongAway = 0x00000010, + cssLightDND = 0x00000020, + cssHeavyDND = 0x00000040, + cssFreeChart = 0x00000080, + cssOutToLunch = 0x00000100, + cssOnThePhone = 0x00000200, + cssIdle = 0x00000400, + cssAll = 0x80000000 }; static unsigned long Status2Flag(int status) { - switch(status) - { - case ID_STATUS_ONLINE: return cssOnline; - case ID_STATUS_OFFLINE: return cssOffline; - case ID_STATUS_INVISIBLE: return cssInvisible; - case ID_STATUS_OUTTOLUNCH: return cssOutToLunch; - case ID_STATUS_ONTHEPHONE: return cssOnThePhone; - case ID_STATUS_AWAY: return cssShortAway; - case ID_STATUS_NA: return cssLongAway; - case ID_STATUS_OCCUPIED: return cssLightDND; - case ID_STATUS_DND: return cssHeavyDND; - case ID_STATUS_FREECHAT: return cssFreeChart; - case ID_STATUS_IDLE: return cssIdle; + switch (status) { + case ID_STATUS_ONLINE: return cssOnline; + case ID_STATUS_OFFLINE: return cssOffline; + case ID_STATUS_INVISIBLE: return cssInvisible; + case ID_STATUS_OUTTOLUNCH: return cssOutToLunch; + case ID_STATUS_ONTHEPHONE: return cssOnThePhone; + case ID_STATUS_AWAY: return cssShortAway; + case ID_STATUS_NA: return cssLongAway; + case ID_STATUS_OCCUPIED: return cssLightDND; + case ID_STATUS_DND: return cssHeavyDND; + case ID_STATUS_FREECHAT: return cssFreeChart; + case ID_STATUS_IDLE: return cssIdle; } return 0; } @@ -66,7 +63,8 @@ class COptions PrevStatus(const char *_proto, int _status) : szProto(mir_strdup(_proto)), iStatus(_status) - {} + { + } ptrA szProto; int iStatus; @@ -74,69 +72,71 @@ class COptions OBJLIST m_aProtocol2Status; static int CompareStatuses(const PrevStatus *p1, const PrevStatus *p2) - { return mir_strcmp(p1->szProto, p2->szProto); + { + return mir_strcmp(p1->szProto, p2->szProto); } public: COptions() : m_aProtocol2Status(3, CompareStatuses) - {} + { + } bool IsProtocolExcluded(const char* pszProtocol)const { - DWORD dwSettings = db_get_dw(NULL,pszProtocol,"ChangeSkypeStatus_Exclusions",0); + DWORD dwSettings = db_get_dw(NULL, pszProtocol, "ChangeSkypeStatus_Exclusions", 0); return ((dwSettings&cssAll) ? true : false); } - bool IsProtocolStatusExcluded(const char* pszProtocol,int nStatus)const + bool IsProtocolStatusExcluded(const char* pszProtocol, int nStatus)const { - DWORD dwSettings = db_get_dw(NULL,pszProtocol,"ChangeSkypeStatus_Exclusions",0); + DWORD dwSettings = db_get_dw(NULL, pszProtocol, "ChangeSkypeStatus_Exclusions", 0); return ((dwSettings&Status2Flag(nStatus)) ? true : false); } - void ExcludeProtocol(const char* pszProtocol,bool bExclude) + void ExcludeProtocol(const char* pszProtocol, bool bExclude) { - DWORD dwSettings = db_get_dw(NULL,pszProtocol,"ChangeSkypeStatus_Exclusions",0); + DWORD dwSettings = db_get_dw(NULL, pszProtocol, "ChangeSkypeStatus_Exclusions", 0); if (bExclude) - dwSettings |=cssAll; + dwSettings |= cssAll; else dwSettings &= ~cssAll; - db_set_dw(NULL,pszProtocol,"ChangeSkypeStatus_Exclusions",dwSettings); + db_set_dw(NULL, pszProtocol, "ChangeSkypeStatus_Exclusions", dwSettings); } - void ExcludeProtocolStatus(const char* pszProtocol,int nStatus,bool bExclude) + void ExcludeProtocolStatus(const char* pszProtocol, int nStatus, bool bExclude) { - DWORD dwSettings = db_get_dw(NULL,pszProtocol,"ChangeSkypeStatus_Exclusions",0); + DWORD dwSettings = db_get_dw(NULL, pszProtocol, "ChangeSkypeStatus_Exclusions", 0); if (bExclude) - dwSettings |=Status2Flag(nStatus); + dwSettings |= Status2Flag(nStatus); else dwSettings &= ~Status2Flag(nStatus); - db_set_dw(NULL,pszProtocol,"ChangeSkypeStatus_Exclusions",dwSettings); + db_set_dw(NULL, pszProtocol, "ChangeSkypeStatus_Exclusions", dwSettings); } - bool GetSyncStatusMsgFlag()const + bool GetSyncStatusMsgFlag() const { - return db_get_b(NULL,MODULENAME,"SyncStatusMsg",false) > 0; + return g_plugin.getBool("SyncStatusMsg"); } - bool GetSyncStatusStateFlag()const + bool GetSyncStatusStateFlag() const { - return db_get_b(NULL,MODULENAME,"SyncStatusState",false) > 0; + return g_plugin.getBool("SyncStatusState"); } void SetSyncStatusMsgFlag(bool b) { - db_set_b(NULL,MODULENAME,"SyncStatusMsg",b); + g_plugin.setByte("SyncStatusMsg", b); } void SetSyncStatusStateFlag(bool b) { - db_set_b(NULL,MODULENAME,"SyncStatusState",b); + g_plugin.setByte("SyncStatusState", b); } - bool GetPreviousStatus(const char* pszProtocol,int& nStatus)const + bool GetPreviousStatus(const char* pszProtocol, int& nStatus)const { int i = m_aProtocol2Status.getIndex((PrevStatus*)&pszProtocol); if (i != -1) { @@ -147,13 +147,13 @@ public: return false; } - void SetPreviousStatus(const char* pszProtocol,int nStatus) + void SetPreviousStatus(const char* pszProtocol, int nStatus) { int i = m_aProtocol2Status.getIndex((PrevStatus*)&pszProtocol); if (i != -1) m_aProtocol2Status[i].iStatus = nStatus; else - m_aProtocol2Status.insert( new PrevStatus(pszProtocol, nStatus)); + m_aProtocol2Status.insert(new PrevStatus(pszProtocol, nStatus)); } }; diff --git a/plugins/SplashScreen/src/main.cpp b/plugins/SplashScreen/src/main.cpp index 403e9a7d04..49b1034086 100644 --- a/plugins/SplashScreen/src/main.cpp +++ b/plugins/SplashScreen/src/main.cpp @@ -51,7 +51,7 @@ PLUGININFOEX pluginInfoEx = { }; CMPlugin::CMPlugin() : - PLUGIN(MODULENAME, pluginInfoEx) + PLUGIN("SplashScreen", pluginInfoEx) {} ///////////////////////////////////////////////////////////////////////////////////////// diff --git a/plugins/SplashScreen/src/stdafx.h b/plugins/SplashScreen/src/stdafx.h index 5907f3e701..10fd640553 100644 --- a/plugins/SplashScreen/src/stdafx.h +++ b/plugins/SplashScreen/src/stdafx.h @@ -49,7 +49,7 @@ // Internal defines #define SPLASH_CLASS L"MirandaSplash" -#define MODULENAME "SplashScreen" + #define WM_LOADED (WM_USER + 10) struct CMPlugin : public PLUGIN diff --git a/plugins/StartupSilence/src/main.cpp b/plugins/StartupSilence/src/main.cpp index 174962c21d..a13dfb583d 100644 --- a/plugins/StartupSilence/src/main.cpp +++ b/plugins/StartupSilence/src/main.cpp @@ -163,7 +163,7 @@ void InitSettings() mir_snprintf(NonStatusAllowComp, "%s_NonStatusAllow", hostname); } //first run on the host, initial setting - if (!(delay = db_get_dw(0, MODULENAME, DelayComp, 0))) + if (!(delay = g_plugin.getDword(DelayComp, 0))) DefSettings(); //or load host settings else LoadSettings(); @@ -186,16 +186,16 @@ void DefSettings() void LoadSettings() { - Enabled = g_plugin.getByte(EnabledComp, 0); - delay = g_plugin.getDword(DelayComp, 0); - PopUp = g_plugin.getByte(PopUpComp, 0); - PopUpTime = g_plugin.getDword(PopUpTimeComp, 0); - MenuItem = g_plugin.getByte(MenuitemComp, 0); - TTBButtons = g_plugin.getByte(TTBButtonsComp, 0); - DefSound = g_plugin.getByte(DefSoundComp, 0); - DefPopup = g_plugin.getByte(DefPopupComp, 0); - DefEnabled = g_plugin.getByte(DefEnabledComp, 0); - NonStatusAllow = g_plugin.getByte(NonStatusAllowComp, 0); + Enabled = g_plugin.getByte(EnabledComp); + delay = g_plugin.getDword(DelayComp); + PopUp = g_plugin.getByte(PopUpComp); + PopUpTime = g_plugin.getDword(PopUpTimeComp); + MenuItem = g_plugin.getByte(MenuitemComp); + TTBButtons = g_plugin.getByte(TTBButtonsComp); + DefSound = g_plugin.getByte(DefSoundComp); + DefPopup = g_plugin.getByte(DefPopupComp); + DefEnabled = g_plugin.getByte(DefEnabledComp); + NonStatusAllow = g_plugin.getByte(NonStatusAllowComp); if (PopUpTime < 1) PopUpTime = (DWORD)1; if (PopUpTime > 30) @@ -334,7 +334,7 @@ static INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LP min = GetDlgItemInt(hwndDlg, IDC_SSTIME, nullptr, FALSE); if (min == 0 && GetWindowTextLength(GetDlgItem(hwndDlg, IDC_SSTIME))) SendDlgItemMessage(hwndDlg, IDC_SSSPIN, UDM_SETPOS, 0, MAKELONG((short)1, 0)); - delay = (DWORD)db_set_dw(0, MODULENAME, DelayComp, (DWORD)(SendDlgItemMessage(hwndDlg, IDC_SSSPIN, UDM_GETPOS, 0, 0))); + delay = db_set_dw(0, MODULENAME, DelayComp, (DWORD)(SendDlgItemMessage(hwndDlg, IDC_SSSPIN, UDM_GETPOS, 0, 0))); break; case IDC_SSPOPUPTIME: @@ -342,7 +342,7 @@ static INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LP min = GetDlgItemInt(hwndDlg, IDC_SSPOPUPTIME, nullptr, FALSE); if (min == 0 && GetWindowTextLength(GetDlgItem(hwndDlg, IDC_SSPOPUPTIME))) SendDlgItemMessage(hwndDlg, IDC_SSSPIN2, UDM_SETPOS, 0, MAKELONG((short)1, 0)); - PopUpTime = (DWORD)db_set_dw(0, MODULENAME, PopUpTimeComp, (DWORD)(SendDlgItemMessage(hwndDlg, IDC_SSSPIN2, UDM_GETPOS, 0, 0))); + PopUpTime = db_set_dw(0, MODULENAME, PopUpTimeComp, (DWORD)(SendDlgItemMessage(hwndDlg, IDC_SSSPIN2, UDM_GETPOS, 0, 0))); break; case IDC_DELAY: @@ -353,41 +353,41 @@ static INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LP if (!ServiceExists(MS_POPUP_QUERY)) { MessageBox(nullptr, NEEDPOPUP, NOTICE, MB_OK); CheckDlgButton(hwndDlg, IDC_DELAY2, BST_UNCHECKED); - PopUp = (BYTE)db_set_b(0, MODULENAME, PopUpComp, 0); + PopUp = db_set_b(0, MODULENAME, PopUpComp, 0); } - else PopUp = (BYTE)db_set_b(0, MODULENAME, PopUpComp, (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_DELAY2) == BST_CHECKED ? 1 : 0)); + else PopUp = db_set_b(0, MODULENAME, PopUpComp, IsDlgButtonChecked(hwndDlg, IDC_DELAY2) == BST_CHECKED); break; case IDC_MENU: - MenuItem = (BYTE)db_set_b(0, MODULENAME, MenuitemComp, (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_MENU) == BST_CHECKED ? 1 : 0)); + MenuItem = db_set_b(0, MODULENAME, MenuitemComp, IsDlgButtonChecked(hwndDlg, IDC_MENU) == BST_CHECKED); break; case IDC_TTB: if (!hTTBarloaded) { MessageBox(nullptr, NEEDTTBMOD, NOTICE, MB_OK); CheckDlgButton(hwndDlg, IDC_TTB, BST_UNCHECKED); - TTBButtons = (BYTE)db_set_b(0, MODULENAME, TTBButtonsComp, 0); + TTBButtons = db_set_b(0, MODULENAME, TTBButtonsComp, 0); } - else TTBButtons = (BYTE)db_set_b(0, MODULENAME, TTBButtonsComp, (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_TTB) == BST_CHECKED ? 1 : 0)); + else TTBButtons = db_set_b(0, MODULENAME, TTBButtonsComp, IsDlgButtonChecked(hwndDlg, IDC_TTB) == BST_CHECKED); break; case IDC_DEFPOPUP: - db_set_b(0, MODULENAME, DefPopupComp, (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_DEFPOPUP) == BST_CHECKED ? 1 : 0)); + g_plugin.setByte(DefPopupComp, IsDlgButtonChecked(hwndDlg, IDC_DEFPOPUP) == BST_CHECKED); DefPopup = g_plugin.getByte(DefPopupComp, 0); break; case IDC_DEFSOUNDS: - db_set_b(0, MODULENAME, DefSoundComp, (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_DEFSOUNDS) == BST_CHECKED ? 1 : 0)); + g_plugin.setByte(DefSoundComp, IsDlgButtonChecked(hwndDlg, IDC_DEFSOUNDS) == BST_CHECKED); DefSound = g_plugin.getByte(DefSoundComp, 0); break; case IDC_RESTORE: - db_set_b(0, MODULENAME, DefEnabledComp, (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_RESTORE) == BST_CHECKED ? 1 : 0)); + g_plugin.setByte(DefEnabledComp, IsDlgButtonChecked(hwndDlg, IDC_RESTORE) == BST_CHECKED); DefEnabled = g_plugin.getByte(DefEnabledComp, 0); break; case IDC_NONSTATUSES: - db_set_b(0, MODULENAME, NonStatusAllowComp, (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_NONSTATUSES) == BST_CHECKED ? 1 : 0)); + g_plugin.setByte(NonStatusAllowComp, IsDlgButtonChecked(hwndDlg, IDC_NONSTATUSES) == BST_CHECKED); NonStatusAllow = g_plugin.getByte(NonStatusAllowComp, 0); break; diff --git a/plugins/mTextControl/src/main.cpp b/plugins/mTextControl/src/main.cpp index 44c04969cb..512b86a543 100644 --- a/plugins/mTextControl/src/main.cpp +++ b/plugins/mTextControl/src/main.cpp @@ -45,7 +45,7 @@ PLUGININFOEX pluginInfoEx = }; CMPlugin::CMPlugin() : - PLUGIN(MODULENAME, pluginInfoEx) + PLUGIN("MTextControl", pluginInfoEx) {} ///////////////////////////////////////////////////////////////////////////////////////// diff --git a/plugins/mTextControl/src/stdafx.h b/plugins/mTextControl/src/stdafx.h index 2edf57f236..27ec265e2d 100644 --- a/plugins/mTextControl/src/stdafx.h +++ b/plugins/mTextControl/src/stdafx.h @@ -47,9 +47,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #include "fancy_rtf.h" #include "textcontrol.h" -#define MODULENAME "MTextControl" // DB module for this plugin -#define MODULNAMEW L"MTextControl" // DB module for this plugin - #define MODULTITLE "Text Display" // globals diff --git a/plugins/mTextControl/src/textcontrol.cpp b/plugins/mTextControl/src/textcontrol.cpp index a033bb1799..a9f3263794 100644 --- a/plugins/mTextControl/src/textcontrol.cpp +++ b/plugins/mTextControl/src/textcontrol.cpp @@ -32,19 +32,14 @@ struct TextControlData void MTextControl_RegisterClass() { - WNDCLASSEX wcl; + WNDCLASSEX wcl = {}; wcl.cbSize = sizeof(wcl); wcl.lpfnWndProc = MTextControlWndProc; wcl.style = CS_GLOBALCLASS; - wcl.cbClsExtra = 0; - wcl.cbWndExtra = 0; wcl.hInstance = g_plugin.getInst(); - wcl.hIcon = nullptr; wcl.hCursor = LoadCursor(nullptr, IDC_ARROW); wcl.hbrBackground = (HBRUSH)GetStockObject(LTGRAY_BRUSH); - wcl.lpszMenuName = nullptr; - wcl.lpszClassName = MODULNAMEW; - wcl.hIconSm = nullptr; + wcl.lpszClassName = L"MTextControl"; RegisterClassEx(&wcl); } diff --git a/plugins/wbOSD/src/main.cpp b/plugins/wbOSD/src/main.cpp index 3539f32de0..dc2167b8b1 100644 --- a/plugins/wbOSD/src/main.cpp +++ b/plugins/wbOSD/src/main.cpp @@ -33,7 +33,7 @@ static PLUGININFOEX pluginInfoEx = { }; CMPlugin::CMPlugin() : - PLUGIN(MODULENAME, pluginInfoEx) + PLUGIN("mirandaosd", pluginInfoEx) {} ///////////////////////////////////////////////////////////////////////////////////////// diff --git a/plugins/wbOSD/src/stdafx.h b/plugins/wbOSD/src/stdafx.h index 4a22046169..2d903930f9 100644 --- a/plugins/wbOSD/src/stdafx.h +++ b/plugins/wbOSD/src/stdafx.h @@ -26,8 +26,6 @@ Distributed under GNU's GPL 2 or later #include "resource.h" #include "version.h" -#define MODULENAME "mirandaosd" - struct CMPlugin : public PLUGIN { CMPlugin(); -- cgit v1.2.3