summaryrefslogtreecommitdiff
path: root/src/modules/plugins/newplugins.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-08-10 11:20:41 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-08-10 11:20:41 +0000
commitf4bbfd279142b7de205da42799423b6c68b84b4d (patch)
treed5013ae4f2cd1b72a7a5782415c03834c9541bdf /src/modules/plugins/newplugins.cpp
parent5de350979644c379219f74df08fb00aca537c3c6 (diff)
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
Diffstat (limited to 'src/modules/plugins/newplugins.cpp')
-rw-r--r--src/modules/plugins/newplugins.cpp39
1 files changed, 27 insertions, 12 deletions
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;
}