diff options
author | George Hazan <george.hazan@gmail.com> | 2012-07-28 16:23:55 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-07-28 16:23:55 +0000 |
commit | f3311cd7eb5e87b3718f763a3c08cd3764c84f51 (patch) | |
tree | dfca74c5949383d9bfcfed1bbed0dd3e9d4a67bb /src/modules/database/dbutils.cpp | |
parent | c420cf1a7491cedc2d073d22d37b12a3a581bc44 (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/modules/database/dbutils.cpp')
-rw-r--r-- | src/modules/database/dbutils.cpp | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/modules/database/dbutils.cpp b/src/modules/database/dbutils.cpp index 1e62b160b4..cca96a763c 100644 --- a/src/modules/database/dbutils.cpp +++ b/src/modules/database/dbutils.cpp @@ -304,9 +304,16 @@ static INT_PTR GetProfileNameW(WPARAM wParam, LPARAM lParam) return 0;
}
+static INT_PTR SetDefaultProfile(WPARAM wParam, LPARAM lParam)
+{
+ extern TCHAR* g_defaultProfile;
+ replaceStrT(g_defaultProfile, (TCHAR*)wParam);
+ return 0;
+}
+
/////////////////////////////////////////////////////////////////////////////////////////
-int InitUtils()
+int LoadEventsModule()
{
bModuleInitialized = TRUE;
@@ -322,16 +329,17 @@ int InitUtils() CreateServiceFunction(MS_DB_GETPROFILENAME, GetProfileName);
CreateServiceFunction(MS_DB_GETPROFILEPATHW, GetProfilePathW);
CreateServiceFunction(MS_DB_GETPROFILENAMEW, GetProfileNameW);
+
+ CreateServiceFunction(MS_DB_SETDEFAULTPROFILE, SetDefaultProfile);
return 0;
}
void UnloadEventsModule()
{
- int i;
-
- if ( !bModuleInitialized) return;
+ if ( !bModuleInitialized)
+ return;
- for (i=0; i < eventTypes.getCount(); i++) {
+ for (int i=0; i < eventTypes.getCount(); i++) {
DBEVENTTYPEDESCR* p = eventTypes[i];
mir_free(p->module);
mir_free(p->descr);
|