diff options
-rw-r--r-- | plugins/CrashDumper/src/dumper.cpp | 2 | ||||
-rw-r--r-- | plugins/CrashDumper/src/stdafx.h | 1 | ||||
-rw-r--r-- | plugins/CrashDumper/src/utils.cpp | 9 | ||||
-rw-r--r-- | plugins/PackUpdater/Src/Utils.cpp | 10 | ||||
-rw-r--r-- | plugins/RemovePersonalSettings/src/rps.cpp | 8 | ||||
-rw-r--r-- | plugins/RemovePersonalSettings/src/stdafx.h | 2 | ||||
-rw-r--r-- | plugins/StatusManager/src/options.cpp | 8 | ||||
-rw-r--r-- | src/mir_app/src/newplugins.cpp | 10 |
8 files changed, 14 insertions, 36 deletions
diff --git a/plugins/CrashDumper/src/dumper.cpp b/plugins/CrashDumper/src/dumper.cpp index 4c81bcfbbb..d44823bf55 100644 --- a/plugins/CrashDumper/src/dumper.cpp +++ b/plugins/CrashDumper/src/dumper.cpp @@ -169,7 +169,7 @@ static void GetPluginsString(CMStringW &buffer, unsigned &flags) }
if (hModule == nullptr) {
- if ((flags & VI_FLAG_PRNVAR) && IsPluginEnabled(FindFileData.cFileName)) {
+ if ((flags & VI_FLAG_PRNVAR) && IsPluginOnWhiteList(_T2A(FindFileData.cFileName))) {
wchar_t timebuf[30] = L"";
GetLastWriteTime(&FindFileData.ftLastWriteTime, timebuf, 30);
diff --git a/plugins/CrashDumper/src/stdafx.h b/plugins/CrashDumper/src/stdafx.h index 6270d4c932..0059d13503 100644 --- a/plugins/CrashDumper/src/stdafx.h +++ b/plugins/CrashDumper/src/stdafx.h @@ -131,7 +131,6 @@ void GetLastWriteTime(LPCTSTR fileName, LPTSTR lpszString, DWORD dwSize); void GetLastWriteTime(FILETIME* ftime, LPTSTR lpszString, DWORD dwSize);
void StoreStringToClip(CMStringW& buffer);
void ShowMessage(int type, const wchar_t* format, ...);
-bool IsPluginEnabled(wchar_t* filename);
const PLUGININFOEX* GetMirInfo(HMODULE hModule);
diff --git a/plugins/CrashDumper/src/utils.cpp b/plugins/CrashDumper/src/utils.cpp index 8b59693f01..b67f389f15 100644 --- a/plugins/CrashDumper/src/utils.cpp +++ b/plugins/CrashDumper/src/utils.cpp @@ -415,12 +415,3 @@ void StoreStringToClip(CMStringW& buffer) CloseClipboard();
}
}
-
-bool IsPluginEnabled(wchar_t* filename)
-{
- char* fname;
- crsi_t2a(fname, filename);
- char* ext = strstr(_strlwr(fname), ".dll");
- bool res = ext && ext[4] == '\0' && db_get_b(0, "PluginDisable", fname, 0) == 0;
- return res;
-}
diff --git a/plugins/PackUpdater/Src/Utils.cpp b/plugins/PackUpdater/Src/Utils.cpp index e2a057fb1f..33c28584f1 100644 --- a/plugins/PackUpdater/Src/Utils.cpp +++ b/plugins/PackUpdater/Src/Utils.cpp @@ -159,14 +159,6 @@ BOOL Exists(LPCTSTR strName) return GetFileAttributes(strName) != INVALID_FILE_ATTRIBUTES;
}
-BOOL IsPluginDisabled(wchar_t* filename)
-{
- char* fname = mir_u2a(filename);
- int res = db_get_b(0, "PluginDisable", fname, 0);
- mir_free(fname);
- return res;
-}
-
size_t getVer(const wchar_t* verStr)
{
int v1 = 0, v2 = 0, v3 = 0, v4 = 0;
@@ -267,7 +259,7 @@ static void CheckUpdates(void *) mir_snwprintf(tszBuff, L"Plugins\\%s\\%s", Files[CurrentFile].tszAdvFolder, Files[CurrentFile].File.tszDiskPath);
wchar_t pluginFolderName[MAX_PATH];
PathToAbsoluteW(tszBuff, pluginFolderName);
- if (!Files[CurrentFile].Force && (IsPluginDisabled(Files[CurrentFile].File.tszDiskPath) || !Exists(pluginFolderName))) //check if plugin disabled or not exists
+ if (!Files[CurrentFile].Force && (IsPluginOnWhiteList(_T2A(Files[CurrentFile].File.tszDiskPath)) || !Exists(pluginFolderName))) //check if plugin disabled or not exists
continue;
}
// Compare versions
diff --git a/plugins/RemovePersonalSettings/src/rps.cpp b/plugins/RemovePersonalSettings/src/rps.cpp index 62df6bf23b..1f38b1620e 100644 --- a/plugins/RemovePersonalSettings/src/rps.cpp +++ b/plugins/RemovePersonalSettings/src/rps.cpp @@ -547,12 +547,8 @@ void DisablePlugins() }
// Disable it
- if (name[0] != '\0') {
- CharLowerA(name);
- if (db_get_b(0, PLUGINDISABLELIST, name, 0) != 1) {
- db_set_b(0, PLUGINDISABLELIST, name, 1);
- }
- }
+ if (name[0] != '\0')
+ SetPluginOnWhiteList(name, false);
// Get next one
name = value + mir_strlen(value) + 1;
diff --git a/plugins/RemovePersonalSettings/src/stdafx.h b/plugins/RemovePersonalSettings/src/stdafx.h index 574cd69ad1..e2fbb81aab 100644 --- a/plugins/RemovePersonalSettings/src/stdafx.h +++ b/plugins/RemovePersonalSettings/src/stdafx.h @@ -38,8 +38,6 @@ #define INI_FILE_NAME "RemovePersonalSettings.ini"
-#define PLUGINDISABLELIST "PluginDisable"
-
#define METACONTACTS_PROTOCOL_NAME "MetaContacts"
#define NOTICE_TEXT LPGENW("All your personal settings will be erased!\n\
diff --git a/plugins/StatusManager/src/options.cpp b/plugins/StatusManager/src/options.cpp index 366d834b81..c59fff95fe 100644 --- a/plugins/StatusManager/src/options.cpp +++ b/plugins/StatusManager/src/options.cpp @@ -69,12 +69,8 @@ int OnCommonOptionsInit(WPARAM wParam, LPARAM) static bool IsSubPluginEnabled(const char *name) { - // Check if this plugin was disabled as separate dll - CMStringA dllName(FORMAT, "%s.dll", name); - dllName.MakeLower(); - bool res = !db_get_b(0, "PluginDisable", dllName); - - db_unset(0, "PluginDisable", dllName); + bool res = IsPluginOnWhiteList(name); + SetPluginOnWhiteList(name, true); return res; } diff --git a/src/mir_app/src/newplugins.cpp b/src/mir_app/src/newplugins.cpp index 12918f3426..9f91136a80 100644 --- a/src/mir_app/src/newplugins.cpp +++ b/src/mir_app/src/newplugins.cpp @@ -421,8 +421,14 @@ pluginEntry* OpenPlugin(wchar_t *tszFileName, wchar_t *dir, wchar_t *path) MIR_APP_DLL(void) SetPluginOnWhiteList(const char* szPluginName, bool bAllow)
{
- if (szPluginName != nullptr)
- db_set_b(0, PLUGINDISABLELIST, CPluginName(szPluginName).c_str(), !bAllow);
+ if (szPluginName == nullptr)
+ return;
+
+ CPluginName tmp(szPluginName);
+ if (bAllow)
+ db_unset(0, PLUGINDISABLELIST, tmp);
+ else
+ db_set_b(0, PLUGINDISABLELIST, tmp, 1);
}
// returns 1 if the plugin should be enabled within this profile, filename is always lower case
|