diff options
author | George Hazan <george.hazan@gmail.com> | 2016-04-13 16:49:42 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2016-04-13 16:49:42 +0000 |
commit | b91c28e9293b905402b8cff30e43cf1b3975f54e (patch) | |
tree | 2e5cc4df6efe2c82795f814390a0a74ed16837cf | |
parent | 3ce417fcd492b5ff460cdb5cd857406806e69433 (diff) |
no more direct write access to CListGroups
git-svn-id: http://svn.miranda-ng.org/main/trunk@16645 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r-- | plugins/Utils.pas/mirutils.pas | 40 |
1 files 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;
|