From b91c28e9293b905402b8cff30e43cf1b3975f54e Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 13 Apr 2016 16:49:42 +0000 Subject: no more direct write access to CListGroups git-svn-id: http://svn.miranda-ng.org/main/trunk@16645 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Utils.pas/mirutils.pas | 40 ++-------------------------------------- 1 file changed, 2 insertions(+), 38 deletions(-) diff --git a/plugins/Utils.pas/mirutils.pas b/plugins/Utils.pas/mirutils.pas index 0b5fe5be68..67f085fe0a 100644 --- a/plugins/Utils.pas/mirutils.pas +++ b/plugins/Utils.pas/mirutils.pas @@ -334,11 +334,6 @@ end; // Import plugin function adaptation function CreateGroupW(name:PWideChar;hContact:TMCONTACT):integer; -var - groupId:integer; - groupIdStr:array [0..10] of AnsiChar; - grbuf:array [0..127] of WideChar; - p:PWideChar; begin if (name=nil) or (name^=#0) then begin @@ -346,41 +341,10 @@ begin exit; end; - StrCopyW(@grbuf[1],name); - grbuf[0]:=WideChar(1 or GROUPF_EXPANDED); - - // Check for duplicate & find unused id - groupId:=0; - repeat - p:=DBReadUnicode(0,'CListGroups',IntToStr(groupIdStr,groupId)); - if p=nil then - break; - - if StrCmpW(p+1,@grbuf[1])=0 then - begin - if hContact<>0 then - DBWriteUnicode(hContact,strCList,clGroup,@grbuf[1]); - - mFreeMem(p); - result:=0; - exit; - end; - - mFreeMem(p); - inc(groupId); - until false; - - DBWriteUnicode(0,'CListGroups',groupIdStr,grbuf); + CallService(MS_CLIST_GROUPCREATE,0,lparam(name)); if hContact<>0 then - DBWriteUnicode(hContact,strCList,clGroup,@grbuf[1]); - - p:=StrRScanW(grbuf,'\'); - if p<>nil then - begin - p^:=#0; - CreateGroupW(grbuf+1,0); - end; + DBWriteUnicode(hContact,strCList,clGroup,name); result:=1; end; -- cgit v1.2.3