summaryrefslogtreecommitdiff
path: root/plugins/Import
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2024-01-17 20:56:37 +0300
committerGeorge Hazan <george.hazan@gmail.com>2024-01-17 20:56:37 +0300
commit0408c8952ca633a1ef37e3c4419816fa4ad5c418 (patch)
treebfc994a0ff6c215ac55a9d3f004414f87b66d5ff /plugins/Import
parent78034bcd615e739ad51a1b4bc570b6f1927932fc (diff)
fixes #4109 (Прекратить хранение списка групп в базе)
Diffstat (limited to 'plugins/Import')
-rw-r--r--plugins/Import/src/import.cpp50
-rw-r--r--plugins/Import/src/miranda.cpp4
-rw-r--r--plugins/Import/src/stdafx.h1
3 files changed, 2 insertions, 53 deletions
diff --git a/plugins/Import/src/import.cpp b/plugins/Import/src/import.cpp
index 16a0736334..1297462e3d 100644
--- a/plugins/Import/src/import.cpp
+++ b/plugins/Import/src/import.cpp
@@ -517,43 +517,6 @@ int ModulesEnumProc(const char *szModuleName, void *pParam)
/////////////////////////////////////////////////////////////////////////////////////////
-struct MImportGroup
-{
- MImportGroup(int _n, wchar_t *_nm) :
- wszName(_nm),
- iNumber(_n)
- {}
-
- int iNumber;
- ptrW wszName;
-};
-
-static int ImportGroup(const char* szSettingName, void *param)
-{
- OBJLIST<MImportGroup> *pArray = (OBJLIST<MImportGroup>*)param;
- wchar_t *wszGroupName = g_pBatch->myGetWs(NULL, "CListGroups", szSettingName);
- if (wszGroupName != nullptr)
- pArray->insert(new MImportGroup(atoi(szSettingName), wszGroupName));
- return 0;
-}
-
-int CImportBatch::ImportGroups()
-{
- OBJLIST<MImportGroup> arGroups(10, NumericKeySortT);
- srcDb->EnumContactSettings(NULL, ImportGroup, "CListGroups", &arGroups);
-
- for (auto &it : arGroups) {
- MGROUP group_id = Clist_GroupCreate(0, it->wszName.get() + 1);
- if (group_id <= 0)
- continue;
-
- Clist_GroupSetExpanded(group_id, (it->wszName[0] & GROUPF_EXPANDED));
- }
- return arGroups.getCount();
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-
DBCachedContact* CImportBatch::FindDestMeta(DBCachedContact *ccSrc)
{
for (MCONTACT hMeta = dstDb->FindFirstContact(META_PROTO); hMeta != 0; hMeta = dstDb->FindNextContact(hMeta, META_PROTO)) {
@@ -1023,7 +986,6 @@ void CImportBatch::DoImport()
uint32_t dwTimer = time(0);
OBJLIST<char> arSkippedAccs(1, CompareModules);
- arSkippedAccs.insert(newStr("CListGroups"));
if (!ImportAccounts(arSkippedAccs)) {
AddMessage(LPGENW("Error mapping accounts, exiting."));
return;
@@ -1034,18 +996,6 @@ void CImportBatch::DoImport()
srcDb->EnumModuleNames(CopySystemSettings, &arSkippedAccs);
arSkippedAccs.destroy();
- // Import Groups
- if (m_iOptions & IOPT_GROUPS) {
- AddMessage(LPGENW("Importing groups."));
- nGroupsCount = ImportGroups();
- if (nGroupsCount == -1)
- AddMessage(LPGENW("Group import failed."));
-
- AddMessage(L"");
- }
- dstDb->Flush();
- // End of Import Groups
-
// Import Contacts
if (m_iOptions & IOPT_CONTACTS) {
AddMessage(LPGENW("Importing contacts."));
diff --git a/plugins/Import/src/miranda.cpp b/plugins/Import/src/miranda.cpp
index bad7d76c6b..2faf0e03a7 100644
--- a/plugins/Import/src/miranda.cpp
+++ b/plugins/Import/src/miranda.cpp
@@ -245,7 +245,7 @@ void CMirandaOptionsPageDlg::OnNext()
PostMessage(m_hwndParent, WIZM_GOTOPAGE, IDD_PROGRESS, (LPARAM)new CProgressPageDlg());
}
else if (IsDlgButtonChecked(m_hwnd, IDC_RADIO_ALL)) {
- g_pBatch->m_iOptions = IOPT_HISTORY | IOPT_SYSTEM | IOPT_GROUPS | IOPT_CONTACTS | iFlags;
+ g_pBatch->m_iOptions = IOPT_HISTORY | IOPT_SYSTEM | IOPT_CONTACTS | iFlags;
PostMessage(m_hwndParent, WIZM_GOTOPAGE, IDD_PROGRESS, (LPARAM)new CProgressPageDlg());
}
else if (IsDlgButtonChecked(m_hwnd, IDC_RADIO_CONTACTS)) {
@@ -309,7 +309,7 @@ void CMirandaAdvOptionsPageDlg::OnNext()
g_pBatch->m_iOptions &= IOPT_CHECKDUPS;
if (IsDlgButtonChecked(m_hwnd, IDC_CONTACTS))
- g_pBatch->m_iOptions |= IOPT_CONTACTS | IOPT_GROUPS;
+ g_pBatch->m_iOptions |= IOPT_CONTACTS;
if (IsDlgButtonChecked(m_hwnd, IDC_SYSTEM))
g_pBatch->m_iOptions |= IOPT_SYSTEM;
diff --git a/plugins/Import/src/stdafx.h b/plugins/Import/src/stdafx.h
index 57511c051c..ec15c520db 100644
--- a/plugins/Import/src/stdafx.h
+++ b/plugins/Import/src/stdafx.h
@@ -275,7 +275,6 @@ class CImportBatch : public MZeroedObject
bool ImportAccounts(OBJLIST<char> &arSkippedModules);
MCONTACT ImportContact(MCONTACT hSrc);
void ImportHistory(MCONTACT hContact, PROTOACCOUNT **protocol, int protoCount);
- int ImportGroups();
void ImportMeta(DBCachedContact *ccSrc);
MCONTACT MapContact(MCONTACT hSrc);