From 0408c8952ca633a1ef37e3c4419816fa4ad5c418 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 17 Jan 2024 20:56:37 +0300 Subject: =?UTF-8?q?fixes=20#4109=20(=D0=9F=D1=80=D0=B5=D0=BA=D1=80=D0=B0?= =?UTF-8?q?=D1=82=D0=B8=D1=82=D1=8C=20=D1=85=D1=80=D0=B0=D0=BD=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D0=B5=20=D1=81=D0=BF=D0=B8=D1=81=D0=BA=D0=B0=20=D0=B3?= =?UTF-8?q?=D1=80=D1=83=D0=BF=D0=BF=20=D0=B2=20=D0=B1=D0=B0=D0=B7=D0=B5)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/Import/src/import.cpp | 50 ------------------------------ plugins/Import/src/miranda.cpp | 4 +-- plugins/Import/src/stdafx.h | 1 - plugins/RemovePersonalSettings/src/rps.cpp | 3 -- plugins/Utils.pas/mirutils.pas | 33 +------------------- plugins/mRadio/i_optdlg.inc | 7 +---- 6 files changed, 4 insertions(+), 94 deletions(-) (limited to 'plugins') 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 *pArray = (OBJLIST*)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 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 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 &arSkippedModules); MCONTACT ImportContact(MCONTACT hSrc); void ImportHistory(MCONTACT hContact, PROTOACCOUNT **protocol, int protoCount); - int ImportGroups(); void ImportMeta(DBCachedContact *ccSrc); MCONTACT MapContact(MCONTACT hSrc); diff --git a/plugins/RemovePersonalSettings/src/rps.cpp b/plugins/RemovePersonalSettings/src/rps.cpp index 4e42c5065b..08fc78ed2c 100644 --- a/plugins/RemovePersonalSettings/src/rps.cpp +++ b/plugins/RemovePersonalSettings/src/rps.cpp @@ -370,9 +370,6 @@ void RemoveUsers() DB::ECPTR pCursor(DB::Events(0)); while (pCursor.FetchNext()) pCursor.DeleteEvent(); - - // Now delete groups - DeleteSettingEx("CListGroups", nullptr); } } diff --git a/plugins/Utils.pas/mirutils.pas b/plugins/Utils.pas/mirutils.pas index fb07550f08..a38e15142e 100644 --- a/plugins/Utils.pas/mirutils.pas +++ b/plugins/Utils.pas/mirutils.pas @@ -28,7 +28,6 @@ function ShowVarHelp(dlg:HWND;id:integer=0):integer; function CreateGroupW(name:PWideChar;hContact:TMCONTACT):integer; -function MakeGroupMenu(idxfrom:integer=100):HMENU; function GetNewGroupName(parent:HWND):PWideChar; const @@ -351,36 +350,6 @@ begin result:=StrCmpW(PWideChar(para1),PWideChar(para2)); end; -function MakeGroupMenu(idxfrom:integer=100):HMENU; -var - sl:TSortedList; - i:integer; - b:array [0..15] of AnsiChar; - p:PWideChar; -begin - result:=CreatePopupMenu; - i:=0; - AppendMenuW(result,MF_STRING,idxfrom,TranslateW('')); - AppendMenuW(result,MF_SEPARATOR,0,nil); - FillChar(sl,SizeOf(sl),0); - sl.increment:=16; - sl.sortFunc:=@MyStrSort; - repeat - p:=DBReadUnicode(0,'CListGroups',IntToStr(b,i),nil); - if p=nil then break; - List_InsertPtr(@sl,p+1); - inc(i); - until false; - inc(idxfrom); - for i:=0 to sl.realCount-1 do - begin - AppendMenuW(result,MF_STRING,idxfrom+i,PWideChar(sl.Items[i])); - p:=PWideChar(sl.Items[i])-1; - mFreeMem(p); - end; - List_Destroy(@sl); -end; - function GetNewGroupName(parent:HWND):PWideChar; var mmenu:HMENU; @@ -389,7 +358,7 @@ var pt:TPoint; begin result:=nil; - mmenu:=MakeGroupMenu(100); + mmenu:=Clist_GroupBuildMenu(100); GetCursorPos(pt); i:=integer(TrackPopupMenu(mmenu,TPM_RETURNCMD+TPM_NONOTIFY,pt.x,pt.y,0,parent,nil)); if i>100 then // no root or cancel diff --git a/plugins/mRadio/i_optdlg.inc b/plugins/mRadio/i_optdlg.inc index fe26a0bf11..983406afe4 100644 --- a/plugins/mRadio/i_optdlg.inc +++ b/plugins/mRadio/i_optdlg.inc @@ -168,12 +168,7 @@ begin DBWriteUnicode(i,PluginName,optStationURL,@buf); } // "changing" station group - dst:=GetNewGroupName(Dialog); - if dst<>nil then - DBWriteUnicode(i,strCList,optGroup,dst) - else - db_unset(i,strCList,optGroup); - + Clist_SetGroup(i, GetNewGroupName(Dialog)); end else if loword(wParam)=IDC_ADD_INI then begin -- cgit v1.2.3