From 43ba813ab1bf74c75e426058d7e235f62b0fff52 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 26 Jul 2012 19:07:36 +0000 Subject: added command line /svc:pluginname support to launch service mode plugins automatically git-svn-id: http://svn.miranda-ng.org/main/trunk@1202 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/modules/plugins/newplugins.cpp | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'src/modules/plugins/newplugins.cpp') diff --git a/src/modules/plugins/newplugins.cpp b/src/modules/plugins/newplugins.cpp index dd8c93840a..dec6102770 100644 --- a/src/modules/plugins/newplugins.cpp +++ b/src/modules/plugins/newplugins.cpp @@ -675,7 +675,7 @@ int LoadNewPluginsModule(void) /* enable and disable as needed */ for (i=0; i < clistPlugins.getCount(); i++) - SetPluginOnWhiteList(p->pluginname, clist != clistPlugins[i] ? 0 : 1); + SetPluginOnWhiteList(clistPlugins[i]->pluginname, clist != clistPlugins[i] ? 0 : 1); /* now loop thru and load all the other plugins, do this in one pass */ for (i=0; i < pluginList.getCount(); i++) { @@ -729,9 +729,24 @@ int LoadNewPluginsModuleInfos(void) // look for all *.dll's enumPlugins(scanPluginsDir, 0, 0); // the database will select which db plugin to use, or fail if no profile is selected - if ( LoadDatabaseModule()) return 1; + if ( LoadDatabaseModule()) + return 1; + + if (serviceModePlugin == NULL) { + LPCTSTR param = CmdLine_GetOption( _T("svc")); + if (param != NULL) { + size_t cbLen = _tcslen(param); + for (int i=0; i < servicePlugins.getCount(); i++) { + if ( !_tcsnicmp(servicePlugins[i]->pluginname, param, cbLen)) { + serviceModePlugin = servicePlugins[i]; + break; + } + } + } + } + InitIni(); - // could validate the plugin entries here but internal modules arent loaded so can't call Load(void) in one pass + // could validate the plugin entries here but internal modules arent loaded so can't call Load(void) in one pass return 0; } -- cgit v1.2.3