From 2c6fdda841bfff2425a29c17a0a52a9aa189db42 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 26 Jul 2012 20:58:32 +0000 Subject: service plugins' load order git-svn-id: http://svn.miranda-ng.org/main/trunk@1205 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/core/modules.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'src/core') diff --git a/src/core/modules.cpp b/src/core/modules.cpp index 1023506247..6ada0cf650 100644 --- a/src/core/modules.cpp +++ b/src/core/modules.cpp @@ -25,7 +25,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "../modules/plugins/plugins.h" // other static variables -static BOOL bServiceMode = FALSE; static DWORD mainThreadId; static HANDLE hMainThread; static HANDLE hMissingService; @@ -67,6 +66,7 @@ void UnloadUtilsModule(void); void UnloadButtonModule(void); void UnloadClcModule(void); void UnloadContactListModule(void); +void UnloadDatabase(void); void UnloadEventsModule(void); void UnloadSslModule(void); void UnloadNetlibModule(void); @@ -101,11 +101,16 @@ int LoadDefaultModules(void) // if ( LoadErrorsModule()) return 1; - bServiceMode = LoadServiceModePlugin(); - switch (bServiceMode) { - case 1: return 0; // stop loading here - case 0: break; - default: return 1; + switch ( LoadServiceModePlugin()) { + case SERVICE_CONTINUE: // continue loading Miranda normally + break; + case SERVICE_ONLYDB: // load database and go to the message cycle + return 0; + case SERVICE_MONOPOLY: // unload database and go to the message cycle + UnloadDatabase(); + return 0; + default: // smth went wrong, terminating + return 1; } if ( LoadSkinSounds()) return 1; -- cgit v1.2.3