summaryrefslogtreecommitdiff
path: root/plugins/Import
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2016-09-14 18:01:49 +0000
committerGeorge Hazan <george.hazan@gmail.com>2016-09-14 18:01:49 +0000
commit7bdb598e26e7e98788933af43090d34027166969 (patch)
tree65c215c0693c86134e471f0746e9726b645b51bb /plugins/Import
parent9f285a935709f4dda1065d6450739476168c43af (diff)
second major wipeout of database services & structures:
- DBCONTACTENUMSETTINGS removed; - all helpers moved to mir_core.dll git-svn-id: http://svn.miranda-ng.org/main/trunk@17296 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Import')
-rw-r--r--plugins/Import/src/import.cpp23
1 files changed, 6 insertions, 17 deletions
diff --git a/plugins/Import/src/import.cpp b/plugins/Import/src/import.cpp
index b163428edb..62b4260e8a 100644
--- a/plugins/Import/src/import.cpp
+++ b/plugins/Import/src/import.cpp
@@ -163,12 +163,7 @@ static int CopySettingsEnum(const char *szSetting, LPARAM lParam)
void CopySettings(MCONTACT srcID, const char *szSrcModule, MCONTACT dstID, const char *szDstModule)
{
LIST<char> arSettings(50);
-
- DBCONTACTENUMSETTINGS dbces = { 0 };
- dbces.szModule = szSrcModule;
- dbces.pfnEnumProc = CopySettingsEnum;
- dbces.lParam = (LPARAM)&arSettings;
- srcDb->EnumContactSettings(srcID, &dbces);
+ srcDb->EnumContactSettings(srcID, CopySettingsEnum, szSrcModule, &arSettings);
for (int i = arSettings.getCount() - 1; i >= 0; i--) {
DBVARIANT dbv = { 0 };
@@ -527,9 +522,9 @@ static MCONTACT MapContact(MCONTACT hSrc)
static MCONTACT AddContact(char *szProto, char *pszUniqueSetting, DBVARIANT *id, const wchar_t *pszUserID, wchar_t *nick, wchar_t *group)
{
- MCONTACT hContact = CallService(MS_DB_CONTACT_ADD, 0, 0);
+ MCONTACT hContact = db_add_contact();
if (Proto_AddToContact(hContact, szProto) != 0) {
- CallService(MS_DB_CONTACT_DELETE, hContact, 0);
+ db_delete_contact(hContact);
AddMessage(LPGENW("Failed to add %S contact %s"), szProto, pszUserID);
return INVALID_CONTACT_ID;
}
@@ -572,8 +567,7 @@ void ImportContactSettings(AccountMap *pda, MCONTACT hSrc, MCONTACT hDst)
return;
ImportContactData icd = { hSrc, hDst, pda->szSrcAcc, pda->pa->szModuleName };
-
- CallService(MS_DB_MODULES_ENUM, (WPARAM)&icd, (LPARAM)ModulesEnumProc);
+ db_enum_modules(ModulesEnumProc, &icd);
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -594,12 +588,7 @@ static int ImportGroup(const char* szSettingName, LPARAM lParam)
static int ImportGroups()
{
int nGroups = 0;
-
- DBCONTACTENUMSETTINGS param = { 0 };
- param.szModule = "CListGroups";
- param.pfnEnumProc = ImportGroup;
- param.lParam = (LPARAM)&nGroups;
- srcDb->EnumContactSettings(NULL, &param);
+ db_enum_settings(NULL, ImportGroup, "CListGroups", &nGroups);
return nGroups;
}
@@ -669,7 +658,7 @@ void ImportMeta(DBCachedContact *ccSrc)
// do we need to add a new metacontact?
if (hDest == INVALID_CONTACT_ID) {
- hDest = CallService(MS_DB_CONTACT_ADD, 0, 0);
+ hDest = db_add_contact();
Proto_AddToContact(hDest, META_PROTO);
CopySettings(ccSrc->contactID, META_PROTO, hDest, META_PROTO);