From 509b46f98375153fad4157ceb18a8999fd6294f4 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 29 Mar 2018 19:52:35 +0300 Subject: major clutch removed with double service mode plugins launch --- src/mir_app/src/modules.cpp | 10 ---------- src/mir_app/src/newplugins.cpp | 16 +++++++++------- 2 files changed, 9 insertions(+), 17 deletions(-) (limited to 'src') diff --git a/src/mir_app/src/modules.cpp b/src/mir_app/src/modules.cpp index a4730df8a6..600683eaa4 100644 --- a/src/mir_app/src/modules.cpp +++ b/src/mir_app/src/modules.cpp @@ -101,16 +101,6 @@ int LoadDefaultModules(void) pfn(); } - switch (SetServiceModePlugin(CmdLine_GetOption(L"svc"))) { - case SERVICE_CONTINUE: // continue loading Miranda normally - case SERVICE_ONLYDB: // load database and go to the message cycle - break; - case SERVICE_MONOPOLY: // unload database and go to the message cycle - return 0; - default: // smth went wrong, terminating - return 1; - } - // the database will select which db plugin to use, or fail if no profile is selected if (LoadDatabaseModule()) return 1; diff --git a/src/mir_app/src/newplugins.cpp b/src/mir_app/src/newplugins.cpp index 192b916ab7..9a7b38ff12 100644 --- a/src/mir_app/src/newplugins.cpp +++ b/src/mir_app/src/newplugins.cpp @@ -716,18 +716,16 @@ MIR_APP_DLL(int) SetServiceModePlugin(const wchar_t *wszPluginName) { size_t cbLen = mir_wstrlen(wszPluginName); if (cbLen == 0) - return SERVICE_CONTINUE; + return 1; for (auto &p : servicePlugins) { if (!wcsnicmp(p->pluginname, wszPluginName, cbLen)) { - int res = LaunchServicePlugin(p); - if (res == SERVICE_ONLYDB) // load it later - plugin_service = p; - return res; + plugin_service = p; + return 0; } } - return SERVICE_CONTINUE; + return 2; } ///////////////////////////////////////////////////////////////////////////////////////// @@ -876,7 +874,11 @@ int LoadNewPluginsModuleInfos(void) enumPlugins(scanPluginsDir, 0, 0); MuuidReplacement stdCrypt = { MIID_CRYPTO, L"stdcrypt", nullptr }; - return !LoadCorePlugin(stdCrypt); + if (!LoadCorePlugin(stdCrypt)) + return 1; + + SetServiceModePlugin(CmdLine_GetOption(L"svc")); + return 0; } ///////////////////////////////////////////////////////////////////////////////////////// -- cgit v1.2.3