summaryrefslogtreecommitdiff
path: root/src/modules/database/database.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-07-17 12:51:21 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-07-17 12:51:21 +0000
commit7a65cbd15d4f808f973d782deea2a5e1a02accd6 (patch)
treedb84b5fe05afc63d1d17bec16363410ce799cfe8 /src/modules/database/database.cpp
parent1afab9fe8e14637b5b9b9c4a7d1b16399184fac4 (diff)
obsolete heaader file, m_plugins.h, removed
git-svn-id: http://svn.miranda-ng.org/main/trunk@1005 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules/database/database.cpp')
-rw-r--r--src/modules/database/database.cpp22
1 files changed, 9 insertions, 13 deletions
diff --git a/src/modules/database/database.cpp b/src/modules/database/database.cpp
index 2a8acd4a37..ec25931527 100644
--- a/src/modules/database/database.cpp
+++ b/src/modules/database/database.cpp
@@ -414,10 +414,9 @@ int makeDatabase(TCHAR *profile, DATABASELINK * link, HWND hwndDlg)
}
// enumerate all plugins that had valid DatabasePluginInfo()
-static int FindDbPluginForProfile(const char*, DATABASELINK * dblink, LPARAM lParam)
+static int FindDbPluginForProfile(const TCHAR*, DATABASELINK *dblink, LPARAM lParam)
{
TCHAR* tszProfile = (TCHAR*)lParam;
-
int res = DBPE_CONT;
if (dblink && dblink->cbSize == sizeof(DATABASELINK)) {
char* szProfile = makeFileName(tszProfile);
@@ -450,12 +449,11 @@ static int FindDbPluginForProfile(const char*, DATABASELINK * dblink, LPARAM lPa
}
// enumerate all plugins that had valid DatabasePluginInfo()
-static int FindDbPluginAutoCreate(const char*, DATABASELINK * dblink, LPARAM lParam)
+static int FindDbPluginAutoCreate(const TCHAR* ptszProfile, DATABASELINK * dblink, LPARAM lParam)
{
- TCHAR* tszProfile = (TCHAR*)lParam;
-
int res = DBPE_CONT;
if (dblink && dblink->cbSize == sizeof(DATABASELINK)) {
+ TCHAR* tszProfile = NEWTSTR_ALLOCA(ptszProfile);
CreatePathToFileT(tszProfile);
int err;
@@ -519,21 +517,18 @@ int LoadDatabaseModule(void)
if ( !getProfile(szProfile, SIZEOF(szProfile)))
return 1;
- PLUGIN_DB_ENUM dbe;
- dbe.cbSize = sizeof(PLUGIN_DB_ENUM);
- dbe.lParam = (LPARAM)szProfile;
-
+ pfnDbEnumCallback pFunc;
if (_taccess(szProfile, 0) && shouldAutoCreate(szProfile))
- dbe.pfnEnumCallback = (int(*) (const char*, void*, LPARAM))FindDbPluginAutoCreate;
+ pFunc = FindDbPluginAutoCreate;
else
- dbe.pfnEnumCallback = (int(*) (const char*, void*, LPARAM))FindDbPluginForProfile;
+ pFunc = FindDbPluginForProfile;
// find a driver to support the given profile
bool retry;
int rc;
do {
retry = false;
- rc = CallService(MS_PLUGINS_ENUMDBPLUGINS, 0, (LPARAM)&dbe);
+ rc = enumDbPlugins(pFunc, (LPARAM)szProfile);
switch (rc) {
case -1: {
// no plugins at all
@@ -560,7 +555,8 @@ int LoadDatabaseModule(void)
}
break;
}
- } while (retry);
+ }
+ while (retry);
return (rc != 0);
}