From e412759d7e551e3fc4dc4be6e1fae1cd4f308868 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 3 Jul 2012 21:47:03 +0000 Subject: no more PLUGININFOEX::replacesDefaultModule, that old & nasty clutch since now all Myranda plugins are binary incompatible with Miranda's git-svn-id: http://svn.miranda-ng.org/main/trunk@743 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/modules/plugins/pluginopts.cpp | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'src/modules/plugins/pluginopts.cpp') diff --git a/src/modules/plugins/pluginopts.cpp b/src/modules/plugins/pluginopts.cpp index 83a3c2f4c5..58d5b23128 100644 --- a/src/modules/plugins/pluginopts.cpp +++ b/src/modules/plugins/pluginopts.cpp @@ -26,6 +26,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "plugins.h" +#define IS_DATABASE (1 << 14) + +extern MUUID miid_clist, miid_database; extern HANDLE hShutdownEvent, hPreShutdownEvent; static HANDLE hevLoadModule, hevUnloadModule; @@ -58,8 +61,8 @@ static BOOL dialogListPlugins(WIN32_FIND_DATA* fd, TCHAR* path, WPARAM, LPARAM l if (checkAPI(buf, &pi, MIRANDA_VERSION_CORE, CHECKAPI_NONE) == 0) return TRUE; - int isdb = pi.pluginInfo->replacesDefaultModule == DEFMOD_DB; - int isclist = pi.pluginInfo->replacesDefaultModule == DEFMOD_CLISTALL; + int isdb = hasMuuid(pi, miid_database); + int isclist = hasMuuid(pi, miid_clist); PluginListItemData* dat = (PluginListItemData*)mir_alloc(sizeof(PluginListItemData)); dat->hInst = hInst; @@ -85,7 +88,16 @@ static BOOL dialogListPlugins(WIN32_FIND_DATA* fd, TCHAR* path, WPARAM, LPARAM l ListView_SetItemText(hwndList, iRow, 2, fd->cFileName); - dat->flags = pi.pluginInfo->replacesDefaultModule; + dat->flags = 0; + if (pi.Interfaces) { + MUUID *piface = pi.Interfaces(); + for (int i=0; !equalUUID(miid_last, piface[i]); i++) { + int idx = getDefaultPluginIdx( piface[i] ); + if (idx != -1 ) { + dat->flags |= (1 << idx); + break; + } } } + dat->author = mir_strdup(pi.pluginInfo->author); dat->authorEmail = mir_strdup(pi.pluginInfo->authorEmail); dat->copyright = mir_strdup(pi.pluginInfo->copyright); @@ -211,7 +223,7 @@ static LRESULT CALLBACK PluginListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LP PluginListItemData* dat = (PluginListItemData*)lvi.lParam; if (lvi.iImage == 3) { - if (LoadPluginDynamically(dat)) { + if ( LoadPluginDynamically(dat)) { lvi.iImage = 2; ListView_SetItem(hwnd, &lvi); } @@ -301,7 +313,7 @@ INT_PTR CALLBACK DlgPluginOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar break; PluginListItemData* dat = (PluginListItemData*)it.lParam; - if (dat->flags == DEFMOD_DB) { + if (dat->flags & IS_DATABASE) { ListView_SetItemState(hwndList, hdr->iItem, 0x3000, LVIS_STATEIMAGEMASK); return FALSE; } @@ -314,7 +326,7 @@ INT_PTR CALLBACK DlgPluginOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar dt.iItem = iRow; if (ListView_GetItem(hwndList, &dt)) { PluginListItemData* dat2 = (PluginListItemData*)dt.lParam; - if (dat2->flags == dat->flags) { + if (dat2->flags & dat->flags) { // the lParam is unset, so when the check is unset the clist block doesnt trigger int lParam = dat2->flags; dat2->flags = 0; -- cgit v1.2.3