diff options
author | George Hazan <george.hazan@gmail.com> | 2024-01-17 20:56:37 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2024-01-17 20:56:37 +0300 |
commit | 0408c8952ca633a1ef37e3c4419816fa4ad5c418 (patch) | |
tree | bfc994a0ff6c215ac55a9d3f004414f87b66d5ff /plugins | |
parent | 78034bcd615e739ad51a1b4bc570b6f1927932fc (diff) |
fixes #4109 (Прекратить хранение списка групп в базе)
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/Import/src/import.cpp | 50 | ||||
-rw-r--r-- | plugins/Import/src/miranda.cpp | 4 | ||||
-rw-r--r-- | plugins/Import/src/stdafx.h | 1 | ||||
-rw-r--r-- | plugins/RemovePersonalSettings/src/rps.cpp | 3 | ||||
-rw-r--r-- | plugins/Utils.pas/mirutils.pas | 33 | ||||
-rw-r--r-- | plugins/mRadio/i_optdlg.inc | 7 |
6 files changed, 4 insertions, 94 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);
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('<Root Group>'));
- 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
|