From f4bbfd279142b7de205da42799423b6c68b84b4d Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 10 Aug 2012 11:20:41 +0000 Subject: loading the default clist when no clists are found git-svn-id: http://svn.miranda-ng.org/main/trunk@1424 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/modules/plugins/newplugins.cpp | 39 ++++++++++++++++++++++++++------------ 1 file changed, 27 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/modules/plugins/newplugins.cpp b/src/modules/plugins/newplugins.cpp index 684db5cb0c..b7425cc9a1 100644 --- a/src/modules/plugins/newplugins.cpp +++ b/src/modules/plugins/newplugins.cpp @@ -550,6 +550,23 @@ LBL_Error: return TRUE; } +static bool loadClistModule(TCHAR* exe, pluginEntry *p) +{ + BASIC_PLUGIN_INFO bpi; + if (checkAPI(exe, &bpi, mirandaVersion, CHECKAPI_CLIST)) { + p->bpi = bpi; + p->pclass |= PCLASS_LAST | PCLASS_OK | PCLASS_BASICAPI; + RegisterModule(p->bpi.hInst); + if (bpi.clistlink() == 0) { + p->bpi = bpi; + p->pclass |= PCLASS_LOADED; + return true; + } + Plugin_Uninit(p); + } + return false; +} + static pluginEntry* getCListModule(TCHAR *exe, TCHAR *slice, int useWhiteList) { for (int i=0; i < clistPlugins.getCount(); i++) { @@ -559,19 +576,17 @@ static pluginEntry* getCListModule(TCHAR *exe, TCHAR *slice, int useWhiteList) if (useWhiteList && !isPluginOnWhiteList(p->pluginname)) continue; - BASIC_PLUGIN_INFO bpi; - if (checkAPI(exe, &bpi, mirandaVersion, CHECKAPI_CLIST)) { - p->bpi = bpi; - p->pclass |= PCLASS_LAST | PCLASS_OK | PCLASS_BASICAPI; - RegisterModule(p->bpi.hInst); - if (bpi.clistlink() == 0) { - p->bpi = bpi; - p->pclass |= PCLASS_LOADED; - return p; - } - Plugin_Uninit(p); - } + if ( loadClistModule(exe, p)) + return p; } + + MuuidReplacement& stdClist = pluginDefault[11]; + if ( LoadCorePlugin(stdClist)) { + mir_sntprintf(slice, &exe[MAX_PATH] - slice, _T("\\Core\\%s.dll"), stdClist.stdplugname); + if ( loadClistModule(exe, stdClist.pImpl)) + return stdClist.pImpl; + } + return NULL; } -- cgit v1.2.3