summaryrefslogtreecommitdiff
path: root/src/core/modules.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-07-28 16:23:55 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-07-28 16:23:55 +0000
commitf3311cd7eb5e87b3718f763a3c08cd3764c84f51 (patch)
treedfca74c5949383d9bfcfed1bbed0dd3e9d4a67bb /src/core/modules.cpp
parentc420cf1a7491cedc2d073d22d37b12a3a581bc44 (diff)
- added MS_DB_SETDEFAULTPROFILE service for the service plugins
- added ability to call the service plugin before loading database - changed the core module modules' loading order git-svn-id: http://svn.miranda-ng.org/main/trunk@1225 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/core/modules.cpp')
-rw-r--r--src/core/modules.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/core/modules.cpp b/src/core/modules.cpp
index 6ada0cf650..a1fd29b5c3 100644
--- a/src/core/modules.cpp
+++ b/src/core/modules.cpp
@@ -42,8 +42,10 @@ int LoadProtocolsModule(void); // core: protocol manager
int LoadAccountsModule(void); // core: account manager
int LoadIgnoreModule(void); // protocol filter: ignore
int LoadDbintfModule(void);
+int LoadEventsModule(void);
int LoadContactListModule(void);// ui: clist
+int LoadDatabaseModule(void);
int LoadOptionsModule(void); // ui: options dialog
int LoadFindAddModule(void); // ui: search/add users
int LoadSkinIcons(void);
@@ -60,6 +62,7 @@ int LoadButtonModule(void); // window class: button class
int LoadFontserviceModule(void); // ui: font manager
int LoadIcoLibModule(void); // ui: icons manager
int LoadServiceModePlugin(void);
+int LoadDefaultServiceModePlugin(void);
int LoadErrorsModule();
void UnloadUtilsModule(void);
@@ -92,8 +95,23 @@ int LoadDefaultModules(void)
if ( LoadIcoTabsModule()) return 1;
if ( LoadHeaderbarModule()) return 1;
if ( LoadDbintfModule()) return 1;
+ if ( LoadEventsModule()) return 1;
+
+ // load database drivers & service plugins without executing their Load()
if ( LoadNewPluginsModuleInfos()) return 1;
+ switch ( LoadDefaultServiceModePlugin()) {
+ case SERVICE_CONTINUE: // continue loading Miranda normally
+ 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;
+
// database is available here
if ( LoadButtonModule()) return 1;
if ( LoadIcoLibModule()) return 1;