Jelajahi Sumber

FIX: Update MultiArc configuration

Alexander Koblov 13 tahun lalu
induk
melakukan
3abbc0badd
2 mengubah file dengan 11 tambahan dan 2 penghapusan
  1. 10 2
      components/doublecmd/dcclassesutf8.pas
  2. 1 0
      src/umultiarc.pas

+ 10 - 2
components/doublecmd/dcclassesutf8.pas

@@ -66,7 +66,8 @@ type
 
 
   THackIniFile = class
   THackIniFile = class
   private
   private
-    FFileName: UTF8String;
+    FFileName: String;
+    FSectionList: TIniFileSectionList;
   end;
   end;
 
 
   TIniFileEx = class(TIniFile)
   TIniFileEx = class(TIniFile)
@@ -80,6 +81,8 @@ type
     constructor Create(const AFileName: string; AEscapeLineFeeds : Boolean = False); override;
     constructor Create(const AFileName: string; AEscapeLineFeeds : Boolean = False); override;
     destructor Destroy; override;
     destructor Destroy; override;
     procedure UpdateFile; override;
     procedure UpdateFile; override;
+  public
+    procedure Clear;
     property FileName: UTF8String read GetFileName write SetFileName;
     property FileName: UTF8String read GetFileName write SetFileName;
     property ReadOnly: Boolean read FReadOnly;
     property ReadOnly: Boolean read FReadOnly;
   end;
   end;
@@ -224,7 +227,12 @@ begin
     inherited UpdateFile;
     inherited UpdateFile;
     FileName:= FIniFileStream.FileName;
     FileName:= FIniFileStream.FileName;
   end;
   end;
-end; 
+end;
+
+procedure TIniFileEx.Clear;
+begin
+  THackIniFile(Self).FSectionList.Clear;
+end;
 
 
 destructor TIniFileEx.Destroy;
 destructor TIniFileEx.Destroy;
 begin
 begin

+ 1 - 0
src/umultiarc.pas

@@ -297,6 +297,7 @@ begin
   try
   try
     IniFile:= TIniFileEx.Create(FileName, fmOpenWrite);
     IniFile:= TIniFileEx.Create(FileName, fmOpenWrite);
     try
     try
+      IniFile.Clear;
       for I:= 0 to FList.Count - 1 do
       for I:= 0 to FList.Count - 1 do
       begin
       begin
         Section:= FList.Strings[I];
         Section:= FList.Strings[I];