summaryrefslogtreecommitdiff
path: root/plugins/Actman30/i_options.inc
diff options
context:
space:
mode:
authorAlexey Kulakov <panda75@bk.ru>2014-12-11 09:40:03 +0000
committerAlexey Kulakov <panda75@bk.ru>2014-12-11 09:40:03 +0000
commit4a78501add1e8522d7b95e03a995a2cf2db03766 (patch)
treeff0d144f10106bb0a547b44d73411a5597d9f55a /plugins/Actman30/i_options.inc
parent32e5c1c6b1a151e1dc36ee40e72a3376759578dc (diff)
Actman 30: setting saving and unused macro deleting fix
git-svn-id: http://svn.miranda-ng.org/main/trunk@11322 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Actman30/i_options.inc')
-rw-r--r--plugins/Actman30/i_options.inc18
1 files changed, 13 insertions, 5 deletions
diff --git a/plugins/Actman30/i_options.inc b/plugins/Actman30/i_options.inc
index 488d8a903c..539270be2d 100644
--- a/plugins/Actman30/i_options.inc
+++ b/plugins/Actman30/i_options.inc
@@ -40,7 +40,7 @@ end;
procedure SaveMacros;
var
Macro:pMacroRecord;
- NumMacro:integer;
+ NumMacros:integer;
i:integer;
section:array [0..127] of AnsiChar;
p,p1:PAnsiChar;
@@ -48,11 +48,11 @@ begin
// even if crap in settings, skip on read
DBWriteByte(0,DBBranch,'version' ,3);
- DBDeleteGroup(0,DBBranch,opt_group); //!!
+ OldNumMacros:=DBReadWord(0,DBBranch,opt_nummacro,0);
Macro:=MacroList[0];
i:=MacroList.Count;
- NumMacro:=0;
+ NumMacros:=0;
p1:=StrCopyE(section,opt_group);
while i>0 do
@@ -72,13 +72,21 @@ begin
SaveActions(Macro,section);
- inc(NumMacro);
+ inc(NumMacros);
end;
end;
inc(Macro);
dec(i);
end;
- DBWriteWord(0,DBBranch,opt_nummacro,NumMacro);
+ DBWriteWord(0,DBBranch,opt_nummacro,NumMacros);
+
+ // deleting old unused macro settings
+ while OldNumMacros>NumMacros do
+ begin
+ dec(OldNumMacro);
+ p:=IntToStr(p1,OldNumMacro);
+ DBDeleteGroup(0,DBBranch,section);
+ end;
end;
//===== Load settings =====