summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-03-13 21:01:14 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-03-13 21:01:14 +0000
commit02f6f556ba66dbca3bf939cf9cd3ac010a598d9e (patch)
tree1234a7e017a5729942ad281785e1391080b0d392
parent3510b73d55b198c122ad7e44efedc6b749bc1661 (diff)
fix: Options/Plugins gives the incorrect warning when one switches from tabSRMM to Scriver dynamically
git-svn-id: http://svn.miranda-ng.org/main/trunk@4009 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--src/modules/plugins/pluginopts.cpp28
1 files changed, 13 insertions, 15 deletions
diff --git a/src/modules/plugins/pluginopts.cpp b/src/modules/plugins/pluginopts.cpp
index 0b514b91c1..564413c489 100644
--- a/src/modules/plugins/pluginopts.cpp
+++ b/src/modules/plugins/pluginopts.cpp
@@ -48,7 +48,7 @@ typedef struct
}
PluginListItemData;
-static BOOL dialogListPlugins(WIN32_FIND_DATA* fd, TCHAR* path, WPARAM, LPARAM lParam)
+static BOOL dialogListPlugins(WIN32_FIND_DATA *fd, TCHAR *path, WPARAM, LPARAM lParam)
{
TCHAR buf[MAX_PATH];
mir_sntprintf(buf, SIZEOF(buf), _T("%s\\Plugins\\%s"), path, fd->cFileName);
@@ -163,7 +163,7 @@ static void RemoveAllItems(HWND hwnd)
lvi.iItem ++;
} }
-static int LoadPluginDynamically(PluginListItemData* dat)
+static bool LoadPluginDynamically(PluginListItemData *dat)
{
TCHAR exe[MAX_PATH];
GetModuleFileName(NULL, exe, SIZEOF(exe));
@@ -173,7 +173,7 @@ static int LoadPluginDynamically(PluginListItemData* dat)
if (pPlug->pclass & PCLASS_FAILED) {
LBL_Error:
Plugin_UnloadDyn(pPlug);
- return FALSE;
+ return false;
}
if ( !TryLoadPlugin(pPlug, true))
@@ -184,21 +184,19 @@ LBL_Error:
dat->hInst = pPlug->bpi.hInst;
NotifyEventHooks(hevLoadModule, (WPARAM)pPlug->bpi.pluginInfo, (LPARAM)pPlug->bpi.hInst);
- return TRUE;
+ return true;
}
-static int UnloadPluginDynamically(PluginListItemData* dat)
+static bool UnloadPluginDynamically(PluginListItemData *dat)
{
- pluginEntry tmp;
- _tcsncpy(tmp.pluginname, dat->fileName, SIZEOF(tmp.pluginname)-1);
-
- int idx = pluginList.getIndex(&tmp);
- if (idx == -1)
- return FALSE;
-
- if ( Plugin_UnloadDyn(pluginList[idx]))
+ pluginEntry* p = pluginList.find((pluginEntry*)dat->fileName);
+ if (p) {
+ if ( !Plugin_UnloadDyn(p))
+ return false;
+
dat->hInst = NULL;
- return TRUE;
+ }
+ return true;
}
static LRESULT CALLBACK PluginListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
@@ -310,7 +308,7 @@ INT_PTR CALLBACK DlgPluginOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar
case WM_NOTIFY:
if (lParam) {
- NMLISTVIEW * hdr = (NMLISTVIEW *) lParam;
+ NMLISTVIEW *hdr = (NMLISTVIEW *) lParam;
if (hdr->hdr.code == LVN_ITEMCHANGED && IsWindowVisible(hdr->hdr.hwndFrom)) {
if (hdr->uOldState != 0 && (hdr->uNewState == 0x1000 || hdr->uNewState == 0x2000)) {
HWND hwndList = GetDlgItem(hwndDlg, IDC_PLUGLIST);