mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-08 15:41:12 +02:00
IDE: using TFileStreamUTF8 and TStringListUTF8
git-svn-id: trunk@37656 -
This commit is contained in:
parent
d326a205cc
commit
24c2470b43
@ -1129,13 +1129,11 @@ var
|
||||
if (NewComponents.IndexOf(OverlappedControl)<0)
|
||||
and (OverlappedControl.Left=P.X)
|
||||
and (OverlappedControl.Top=P.Y) then begin
|
||||
// overlaps with an old control => move
|
||||
inc(P.X,NonVisualCompWidth);
|
||||
inc(P.Y,NonVisualCompWidth);
|
||||
if (P.X>AParent.ClientWidth-AControl.Width)
|
||||
or (P.Y>AParent.ClientHeight-AControl.Height) then
|
||||
break;
|
||||
// restart check
|
||||
i:=AParent.ControlCount-1;
|
||||
end else
|
||||
dec(i);
|
||||
|
@ -27,7 +27,7 @@ interface
|
||||
uses
|
||||
Classes, SysUtils, FPCAdds, Forms, Controls, Graphics, Dialogs, LResources,
|
||||
LCLProc, StdCtrls, Buttons, LazConf, LazarusIDEStrConsts, ExtCtrls, ComCtrls,
|
||||
EnvironmentOpts, Clipbrd, FileUtil, Menus, LCLIntf;
|
||||
EnvironmentOpts, Clipbrd, FileUtil, lazutf8classes, Menus, LCLIntf;
|
||||
|
||||
type
|
||||
|
||||
@ -248,7 +248,7 @@ begin
|
||||
//writeln('TAboutForm.LoadContributors ',FileExistsUTF8(ContributorsFileName),' ',ContributorsFileName);
|
||||
|
||||
if FileExistsUTF8(ContributorsFileName) then
|
||||
Contributors.Lines.LoadFromFile(UTF8ToSys(ContributorsFileName))
|
||||
LoadStringsFromFileUTF8(Contributors.Lines,ContributorsFileName)
|
||||
else
|
||||
Contributors.Lines.Text:=lisAboutNoContributors;
|
||||
end;
|
||||
@ -267,7 +267,7 @@ begin
|
||||
+'docs'+PathDelim+'acknowledgements.txt';
|
||||
|
||||
if FileExistsUTF8(AcknowledgementsFileName) then
|
||||
Acknowledgements.Lines.LoadFromFile(UTF8ToSys(AcknowledgementsFileName))
|
||||
LoadStringsFromFileUTF8(Acknowledgements.Lines,AcknowledgementsFileName)
|
||||
else
|
||||
Acknowledgements.Lines.Text:=lisAboutNoContributors;
|
||||
end;
|
||||
|
@ -46,8 +46,8 @@ interface
|
||||
uses
|
||||
Classes, SysUtils, LCLProc, LConvEncoding, Forms, Controls, LCLType, LCLIntf,
|
||||
Graphics, GraphType, StdCtrls, ExtCtrls, Buttons, FileUtil, LazUTF8,
|
||||
LazLogger, Dialogs, InterfaceBase, Themes, CheckLst, Menus, ComCtrls,
|
||||
DividerBevel, DefineTemplates,
|
||||
LazLogger, lazutf8classes, Dialogs, InterfaceBase, Themes, CheckLst, Menus,
|
||||
ComCtrls, DividerBevel, DefineTemplates,
|
||||
// IDEIntf
|
||||
LazIDEIntf, IDEMsgIntf, IDEHelpIntf, IDEImagesIntf, IDEWindowIntf, IDEDialogs,
|
||||
// IDE
|
||||
@ -775,7 +775,7 @@ function SaveIDEMakeOptions(Profile: TBuildLazarusProfile;
|
||||
var
|
||||
ExOptions: String;
|
||||
Filename: String;
|
||||
fs: TFileStream;
|
||||
fs: TFileStreamUTF8;
|
||||
OptionsAsText: String;
|
||||
UpdateRevisionInc: boolean;
|
||||
OutputDirRedirected: boolean;
|
||||
@ -788,7 +788,7 @@ begin
|
||||
Filename:=GetMakeIDEConfigFilename;
|
||||
try
|
||||
InvalidateFileStateCache;
|
||||
fs:=TFileStream.Create(UTF8ToSys(Filename),fmCreate);
|
||||
fs:=TFileStreamUTF8.Create(Filename,fmCreate);
|
||||
try
|
||||
if ExOptions<>'' then begin
|
||||
OptionsAsText:=BreakOptions(ExOptions);
|
||||
|
@ -32,7 +32,8 @@ interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, LCLProc, LResources, Forms, Controls, Graphics, Dialogs,
|
||||
ClipBrd, StdCtrls, Buttons, ExtCtrls, Menus, FileUtil, ButtonPanel,
|
||||
ClipBrd, StdCtrls, Buttons, ExtCtrls, Menus, FileUtil, lazutf8classes,
|
||||
ButtonPanel,
|
||||
// synedit
|
||||
SynEdit, SynHighlighterPas, SynEditAutoComplete, SynRegExpr,
|
||||
// codetools
|
||||
@ -978,7 +979,7 @@ begin
|
||||
s:=EditorOpts.CodeTemplateFileName;
|
||||
if FileExistsUTF8(s) then
|
||||
try
|
||||
AutoCompleteList.LoadFromFile(UTF8ToSys(s));
|
||||
LoadStringsFromFileUTF8(AutoCompleteList,s);
|
||||
except
|
||||
DebugLn('NOTE: unable to read code template file ''',s,'''');
|
||||
end;
|
||||
@ -1021,8 +1022,7 @@ begin
|
||||
Res:=mrOk;
|
||||
repeat
|
||||
try
|
||||
SynAutoComplete.AutoCompleteList.SaveToFile(
|
||||
UTF8ToSys(EditorOpts.CodeTemplateFileName));
|
||||
SaveStringsToFileUTF8(SynAutoComplete.AutoCompleteList,EditorOpts.CodeTemplateFileName);
|
||||
except
|
||||
res:=IDEMessageDialog(lisCCOErrorCaption, 'Unable to write code '
|
||||
+'templates to file '''
|
||||
|
@ -35,7 +35,7 @@ unit CodeToolsOptions;
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, LazConf, FileUtil, Laz2_XMLCfg,
|
||||
Classes, SysUtils, LazConf, FileUtil, Laz2_XMLCfg, lazutf8classes,
|
||||
LResources, Forms, Controls, Buttons, LclProc, ExtCtrls,
|
||||
Dialogs, CodeToolManager, DefineTemplates, SourceChanger, SynEdit,
|
||||
IDEOptionsIntf, IDEOptionDefs, EditDefineTree, LazarusIDEStrConsts, IDEProcs;
|
||||
@ -829,7 +829,7 @@ end;
|
||||
procedure TCodeToolsOptions.CreateDefaultIndentationFile;
|
||||
var
|
||||
res: TLResource;
|
||||
fs: TFileStream;
|
||||
fs: TFileStreamUTF8;
|
||||
begin
|
||||
// indentations (laz_indentation.pas)
|
||||
CopySecondaryConfigFile(DefaultIndentationFilename);
|
||||
@ -839,7 +839,7 @@ begin
|
||||
if (res <> Nil) and (res.Value <> '') and (res.ValueType = 'PAS') then
|
||||
try
|
||||
InvalidateFileStateCache;
|
||||
fs := TFileStream.Create(UTF8ToSys(IndentationFilename), fmCreate);
|
||||
fs := TFileStreamUTF8.Create(IndentationFilename, fmCreate);
|
||||
try
|
||||
fs.Write(res.Value[1], length(res.Value));
|
||||
finally
|
||||
|
@ -36,10 +36,10 @@ unit DialogProcs;
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, LCLProc, LResources, Forms, Controls, Dialogs, FileProcs, FileUtil, LazFileUtils, Laz2_XMLCfg,
|
||||
CodeToolsConfig, CodeCache, CodeToolManager,
|
||||
AVL_Tree, LazIDEIntf,
|
||||
IDEProcs, LazarusIDEStrConsts, IDEDialogs;
|
||||
Classes, SysUtils, LCLProc, LResources, Forms, Controls, Dialogs, FileProcs,
|
||||
FileUtil, LazFileUtils, Laz2_XMLCfg, lazutf8classes, CodeToolsConfig,
|
||||
CodeCache, CodeToolManager, AVL_Tree, LazIDEIntf, IDEProcs,
|
||||
LazarusIDEStrConsts, IDEDialogs;
|
||||
|
||||
type
|
||||
// load buffer flags
|
||||
@ -291,9 +291,9 @@ function LoadStringListFromFile(const Filename, ListTitle: string;
|
||||
begin
|
||||
Result:=mrCancel;
|
||||
if sl=nil then
|
||||
sl:=TStringList.Create;
|
||||
sl:=TStringListUTF8.Create;
|
||||
try
|
||||
sl.LoadFromFile(UTF8ToSys(Filename));
|
||||
LoadStringsFromFileUTF8(sl,Filename);
|
||||
Result:=mrOk;
|
||||
except
|
||||
on E: Exception do begin
|
||||
@ -308,9 +308,9 @@ function SaveStringListToFile(const Filename, ListTitle: string;
|
||||
begin
|
||||
Result:=mrCancel;
|
||||
if sl=nil then
|
||||
sl:=TStringList.Create;
|
||||
sl:=TStringListUTF8.Create;
|
||||
try
|
||||
sl.SaveToFile(UTF8ToSys(Filename));
|
||||
sl.SaveToFile(Filename);
|
||||
Result:=mrOk;
|
||||
except
|
||||
on E: Exception do begin
|
||||
@ -421,14 +421,14 @@ function CheckCreatingFile(const AFilename: string;
|
||||
CheckReadable: boolean; WarnOverwrite: boolean; CreateBackup: boolean
|
||||
): TModalResult;
|
||||
var
|
||||
fs: TFileStream;
|
||||
fs: TFileStreamUTF8;
|
||||
c: char;
|
||||
begin
|
||||
// create if not yet done
|
||||
if not FileExistsCached(AFilename) then begin
|
||||
try
|
||||
InvalidateFileStateCache;
|
||||
fs:=TFileStream.Create(UTF8ToSys(AFilename),fmCreate);
|
||||
fs:=TFileStreamUTF8.Create(AFilename,fmCreate);
|
||||
fs.Free;
|
||||
except
|
||||
Result:=IDEMessageDialog(lisUnableToCreateFile,
|
||||
@ -456,9 +456,9 @@ begin
|
||||
try
|
||||
if CheckReadable then begin
|
||||
InvalidateFileStateCache;
|
||||
fs:=TFileStream.Create(UTF8ToSys(AFilename),fmOpenWrite)
|
||||
fs:=TFileStreamUTF8.Create(AFilename,fmOpenWrite)
|
||||
end else
|
||||
fs:=TFileStream.Create(UTF8ToSys(AFilename),fmOpenReadWrite);
|
||||
fs:=TFileStreamUTF8.Create(AFilename,fmOpenReadWrite);
|
||||
try
|
||||
fs.Position:=fs.Size;
|
||||
c := ' ';
|
||||
@ -475,7 +475,7 @@ begin
|
||||
// check readable
|
||||
try
|
||||
InvalidateFileStateCache;
|
||||
fs:=TFileStream.Create(UTF8ToSys(AFilename),fmOpenReadWrite);
|
||||
fs:=TFileStreamUTF8.Create(AFilename,fmOpenReadWrite);
|
||||
try
|
||||
fs.Position:=fs.Size-1;
|
||||
fs.Read(c,1);
|
||||
@ -609,11 +609,11 @@ end;
|
||||
function SaveStringToFile(const Filename, Content: string;
|
||||
ErrorButtons: TMsgDlgButtons; const Context: string): TModalResult;
|
||||
var
|
||||
fs: TFileStream;
|
||||
fs: TFileStreamUTF8;
|
||||
begin
|
||||
try
|
||||
InvalidateFileStateCache;
|
||||
fs:=TFileStream.Create(UTF8ToSys(Filename),fmCreate);
|
||||
fs:=TFileStreamUTF8.Create(Filename,fmCreate);
|
||||
try
|
||||
if Content<>'' then
|
||||
fs.Write(Content[1],length(Content));
|
||||
|
@ -40,8 +40,8 @@ interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, Math, Forms, Controls, Buttons, StdCtrls, FileUtil,
|
||||
LazarusIDEStrConsts, EditorOptions, LCLType, IDEWindowIntf, IDEHelpIntf,
|
||||
InputHistory, DiffPatch, ExtCtrls, Dialogs, ComCtrls, SynEdit,
|
||||
lazutf8classes, LazarusIDEStrConsts, EditorOptions, LCLType, IDEWindowIntf,
|
||||
IDEHelpIntf, InputHistory, DiffPatch, ExtCtrls, Dialogs, ComCtrls, SynEdit,
|
||||
SynHighlighterDiff, SourceEditor;
|
||||
|
||||
type
|
||||
@ -230,8 +230,12 @@ end;
|
||||
|
||||
procedure TDiffDlg.SaveDiffButtonClick(Sender: TObject);
|
||||
begin
|
||||
if dlgSave.Execute then
|
||||
DiffSynEdit.Lines.SaveToFile(UTF8ToSys(dlgSave.FileName));
|
||||
if dlgSave.Execute then begin
|
||||
try
|
||||
SaveStringsToFileUTF8(DiffSynEdit.Lines,dlgSave.FileName);
|
||||
except
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TDiffDlg.Text1ComboboxChange(Sender: TObject);
|
||||
@ -317,7 +321,7 @@ end;
|
||||
procedure TDiffDlg.OnIdle(Sender: TObject; var Done: Boolean);
|
||||
var
|
||||
Text1Src, Text2Src: string;
|
||||
dat: TStrings;
|
||||
dat: TStringListUTF8;
|
||||
DiffOutput: TDiffOutput;
|
||||
begin
|
||||
IdleConnected := false;
|
||||
@ -327,8 +331,8 @@ begin
|
||||
if (Text1 <> nil) and (Text2 <> nil) then begin
|
||||
if Text1.Editor = nil then
|
||||
begin
|
||||
dat := TStringList.Create;
|
||||
dat.LoadFromFile(UTF8ToSys(Text1.Name));
|
||||
dat := TStringListUTF8.Create;
|
||||
dat.LoadFromFile(Text1.Name);
|
||||
Text1Src := dat.Text;
|
||||
dat.Free;
|
||||
end
|
||||
@ -341,8 +345,8 @@ begin
|
||||
|
||||
if Text2.Editor = nil then
|
||||
begin
|
||||
dat := TStringList.Create;
|
||||
dat.LoadFromFile(UTF8ToSys(Text2.Name));
|
||||
dat := TStringListUTF8.Create;
|
||||
dat.LoadFromFile(Text2.Name);
|
||||
Text2Src := dat.Text;
|
||||
dat.Free;
|
||||
end
|
||||
|
@ -33,7 +33,7 @@ interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, LCLProc, Forms, Controls, Buttons, StdCtrls,
|
||||
Laz2_XMLWrite,
|
||||
Laz2_XMLWrite, lazutf8classes,
|
||||
SynEdit, SynHighlighterDiff, LCLType, ComCtrls, ExtCtrls,
|
||||
FileProcs, CodeToolManager, CodeCache,
|
||||
Project, DiffPatch, LazarusIDEStrConsts, EnvironmentOpts, EditorOptions,
|
||||
@ -104,7 +104,7 @@ function ShowDiskDiffsDialog(AnUnitList, APackageList: TFPList): TModalResult;
|
||||
var
|
||||
i: Integer;
|
||||
CurUnit: TUnitInfo;
|
||||
fs: TFileStream;
|
||||
fs: TFileStreamUTF8;
|
||||
UnitDidNotChange: Boolean;
|
||||
s: string;
|
||||
begin
|
||||
@ -113,7 +113,7 @@ function ShowDiskDiffsDialog(AnUnitList, APackageList: TFPList): TModalResult;
|
||||
CurUnit:=TUnitInfo(AnUnitList[i]);
|
||||
UnitDidNotChange:=false;
|
||||
try
|
||||
fs:=TFileStream.Create(UTF8ToSys(CurUnit.Filename),fmOpenRead);
|
||||
fs:=TFileStreamUTF8.Create(CurUnit.Filename,fmOpenRead);
|
||||
try
|
||||
if fs.Size=CurUnit.Source.SourceLength then begin
|
||||
// size has not changed => load to see difference
|
||||
@ -140,7 +140,7 @@ function ShowDiskDiffsDialog(AnUnitList, APackageList: TFPList): TModalResult;
|
||||
i: Integer;
|
||||
CurPackage: TLazPackage;
|
||||
PackageDidNotChange: Boolean;
|
||||
fs: TFileStream;
|
||||
fs: TFileStreamUTF8;
|
||||
CurSource, DiskSource: string;
|
||||
begin
|
||||
if APackageList=nil then exit;
|
||||
@ -151,7 +151,7 @@ function ShowDiskDiffsDialog(AnUnitList, APackageList: TFPList): TModalResult;
|
||||
continue;// this package was not loaded/saved
|
||||
try
|
||||
CurPackage.SaveToString(CurSource);
|
||||
fs:=TFileStream.Create(UTF8ToSys(CurPackage.Filename),fmOpenRead);
|
||||
fs:=TFileStreamUTF8.Create(CurPackage.Filename,fmOpenRead);
|
||||
try
|
||||
if fs.Size=length(CurSource) then begin
|
||||
// size has not changed => load to see difference
|
||||
@ -272,7 +272,7 @@ end;
|
||||
function TDiskDiffsDlg.GetCachedDiff(FileOwner: TObject): PDiffItem;
|
||||
var
|
||||
i: integer;
|
||||
fs: TFileStream;
|
||||
fs: TFileStreamUTF8;
|
||||
Filename: String;
|
||||
AnUnitInfo: TUnitInfo;
|
||||
APackage: TLazPackage;
|
||||
@ -305,7 +305,7 @@ begin
|
||||
Filename:='';
|
||||
Source:='';
|
||||
end;
|
||||
fs:=TFileStream.Create(UTF8ToSys(Filename),fmOpenRead);
|
||||
fs:=TFileStreamUTF8.Create(Filename,fmOpenRead);
|
||||
SetLength(Result^.TxtOnDisk,fs.Size);
|
||||
if Result^.TxtOnDisk<>'' then
|
||||
fs.Read(Result^.TxtOnDisk[1],length(Result^.TxtOnDisk));
|
||||
|
@ -42,8 +42,8 @@ uses
|
||||
// RTL, FCL
|
||||
Classes, SysUtils, resource,
|
||||
// LCL
|
||||
Controls, ExtCtrls, Graphics, LCLProc, FileUtil, Laz2_XMLCfg, LResources,
|
||||
Forms, Dialogs, ComCtrls,
|
||||
Controls, ExtCtrls, Graphics, LCLProc, FileUtil, Laz2_XMLCfg, lazutf8classes,
|
||||
LResources, Forms, Dialogs, ComCtrls,
|
||||
// Synedit
|
||||
SynEdit, SynEditAutoComplete, SynEditKeyCmds, SynEditTypes,
|
||||
SynEditMiscClasses, SynBeautifier, SynEditTextTrimmer, SynEditMouseCmds,
|
||||
@ -3622,7 +3622,7 @@ end;
|
||||
constructor TEditorOptions.Create;
|
||||
var
|
||||
ConfFileName: String;
|
||||
fs: TFileStream;
|
||||
fs: TFileStreamUTF8;
|
||||
res: TLResource;
|
||||
begin
|
||||
inherited Create;
|
||||
@ -3660,7 +3660,7 @@ begin
|
||||
if (res <> Nil) and (res.Value <> '') and (res.ValueType = 'DCI') then
|
||||
try
|
||||
InvalidateFileStateCache;
|
||||
fs := TFileStream.Create(UTF8ToSys(CodeTemplateFileName), fmCreate);
|
||||
fs := TFileStreamUTF8.Create(CodeTemplateFileName, fmCreate);
|
||||
try
|
||||
fs.Write(res.Value[1], length(res.Value));
|
||||
finally
|
||||
|
@ -30,10 +30,10 @@ unit IDEFPCInfo;
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, AVL_Tree, FileUtil, Forms, Controls, Graphics, Dialogs,
|
||||
StdCtrls, ComCtrls, FileProcs, DefineTemplates, CodeToolManager,
|
||||
BaseBuildManager, Project, EnvironmentOpts, LazarusIDEStrConsts, AboutFrm,
|
||||
IDEWindowIntf;
|
||||
Classes, SysUtils, AVL_Tree, FileUtil, lazutf8classes, Forms, Controls,
|
||||
Graphics, Dialogs, StdCtrls, ComCtrls, FileProcs, DefineTemplates,
|
||||
CodeToolManager, BaseBuildManager, Project, EnvironmentOpts,
|
||||
LazarusIDEStrConsts, AboutFrm, IDEWindowIntf;
|
||||
|
||||
type
|
||||
|
||||
@ -139,7 +139,7 @@ var
|
||||
TestFilename: String;
|
||||
Filename: String;
|
||||
WorkDir: String;
|
||||
fs: TFileStream;
|
||||
fs: TFileStreamUTF8;
|
||||
begin
|
||||
TargetOS:=BuildBoss.GetTargetOS;
|
||||
TargetCPU:=BuildBoss.GetTargetCPU;
|
||||
@ -178,7 +178,7 @@ begin
|
||||
sl.Add('Working directory: '+WorkDir);
|
||||
// create empty file
|
||||
try
|
||||
fs:=TFileStream.Create(UTF8ToSys(TestFilename),fmCreate);
|
||||
fs:=TFileStreamUTF8.Create(TestFilename,fmCreate);
|
||||
fs.Free;
|
||||
except
|
||||
sl.Add('Error: unable to create test file '+TestFilename);
|
||||
|
@ -37,7 +37,8 @@ unit IDEGuiCmdLine;
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, FileUtil, LazConf, LCLProc, LazarusIDEStrConsts, IDECmdLine;
|
||||
Classes, SysUtils, FileUtil, lazutf8classes, LazConf, LCLProc,
|
||||
LazarusIDEStrConsts, IDECmdLine;
|
||||
|
||||
procedure ParseGuiCmdLineParams(var SkipAutoLoadingLastProject,
|
||||
StartedByStartLazarus,
|
||||
@ -174,10 +175,10 @@ function SetupMainIDEInstance: boolean;
|
||||
procedure WritePIDFile(const Filename: string; aPID: int64);
|
||||
var
|
||||
Dir: String;
|
||||
sl: TStringList;
|
||||
sl: TStringListUTF8;
|
||||
begin
|
||||
debugln(['WritePIDFile File="',Filename,'" PID=',aPID]);
|
||||
sl:=TStringList.Create;
|
||||
sl:=TStringListUTF8.Create;
|
||||
try
|
||||
sl.Add(IntToStr(aPID));
|
||||
try
|
||||
@ -187,7 +188,7 @@ function SetupMainIDEInstance: boolean;
|
||||
debugln(['WritePIDFile failed to create directory ',Dir]);
|
||||
exit;
|
||||
end;
|
||||
sl.SaveToFile(UTF8ToSys(Filename));
|
||||
sl.SaveToFile(Filename);
|
||||
except
|
||||
on E: Exception do begin
|
||||
debugln(['WritePIDFile "',Filename,'" failed:']);
|
||||
@ -201,16 +202,16 @@ function SetupMainIDEInstance: boolean;
|
||||
|
||||
function ReadPIDFile(const Filename: string; out ConfigPID: int64): boolean;
|
||||
var
|
||||
sl: TStringList;
|
||||
sl: TStringListUTF8;
|
||||
begin
|
||||
Result:=false;
|
||||
ConfigPID:=-1;
|
||||
debugln(['ReadPIDFile ',Filename]);
|
||||
if not FileExistsUTF8(Filename) then exit;
|
||||
sl:=TStringList.Create;
|
||||
sl:=TStringListUTF8.Create;
|
||||
try
|
||||
try
|
||||
sl.LoadFromFile(UTF8ToSys(Filename));
|
||||
sl.LoadFromFile(Filename);
|
||||
ConfigPID:=StrToInt64(sl[0]);
|
||||
Result:=true;
|
||||
debugln(['ReadPIDFile ConfigPID=',ConfigPID]);
|
||||
@ -227,12 +228,12 @@ function SetupMainIDEInstance: boolean;
|
||||
|
||||
procedure SendCmdlineActionsToMainInstance;
|
||||
var
|
||||
sl: TStringList;
|
||||
sl: TStringListUTF8;
|
||||
Param: String;
|
||||
Filename: String;
|
||||
i: Integer;
|
||||
begin
|
||||
sl:=TStringList.Create;
|
||||
sl:=TStringListUTF8.Create;
|
||||
try
|
||||
sl.Add('Show');
|
||||
for i:=1 to Paramcount do begin
|
||||
@ -243,7 +244,7 @@ function SetupMainIDEInstance: boolean;
|
||||
Filename:=GetRemoteControlFilename;
|
||||
try
|
||||
debugln(['SendCmdlineActionsToMainInstance Commands="',sl.Text,'"']);
|
||||
sl.SaveToFile(UTF8ToSys(Filename));
|
||||
sl.SaveToFile(Filename);
|
||||
except
|
||||
on E: Exception do begin
|
||||
debugln(['SendCmdlineActionsToMainInstance failed to write ',Filename]);
|
||||
|
@ -33,8 +33,9 @@ interface
|
||||
|
||||
uses
|
||||
// FCL+LCL
|
||||
Classes, SysUtils, AVL_Tree, LCLProc, LCLIntf, LCLType, Forms, Controls, Buttons,
|
||||
StdCtrls, Dialogs, ExtCtrls, FileProcs, Graphics, ButtonPanel, LConvEncoding,
|
||||
Classes, SysUtils, AVL_Tree, LCLProc, LCLIntf, LCLType, Forms, Controls,
|
||||
Buttons, StdCtrls, Dialogs, ExtCtrls, FileProcs, Graphics, ButtonPanel,
|
||||
LConvEncoding, lazutf8classes,
|
||||
// CodeTools
|
||||
BasicCodeTools, CodeToolManager, CodeAtom, CodeCache, CustomCodeTool, CodeTree,
|
||||
PascalParserTool, FindDeclarationTool,
|
||||
@ -877,7 +878,7 @@ function TLIHProviders.GetStream(const URL: string; Shared: boolean): TStream;
|
||||
procedure OpenFile(out Stream: TStream; const Filename: string;
|
||||
UseCTCache: boolean);
|
||||
var
|
||||
fs: TFileStream;
|
||||
fs: TFileStreamUTF8;
|
||||
ok: Boolean;
|
||||
Buf: TCodeBuffer;
|
||||
ms: TMemoryStream;
|
||||
@ -895,7 +896,7 @@ function TLIHProviders.GetStream(const URL: string; Shared: boolean): TStream;
|
||||
ok:=false;
|
||||
try
|
||||
DebugLn(['TLIHProviders.GetStream.OpenFile ',Filename]);
|
||||
fs:=TFileStream.Create(UTF8ToSys(Filename),fmOpenRead);
|
||||
fs:=TFileStreamUTF8.Create(Filename,fmOpenRead);
|
||||
Stream:=fs;
|
||||
ok:=true;
|
||||
finally
|
||||
|
@ -31,9 +31,8 @@ interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, FileUtil, LCLProc, AvgLvlTree, Laz2_XMLCfg, LazUTF8,
|
||||
StdCtrls, ExtCtrls,
|
||||
SourceLog, FileProcs, CodeToolManager, CodeToolsConfig, CodeCache,
|
||||
LazConf;
|
||||
lazutf8classes, StdCtrls, ExtCtrls, SourceLog, FileProcs, CodeToolManager,
|
||||
CodeToolsConfig, CodeCache, LazConf;
|
||||
|
||||
type
|
||||
// comments
|
||||
@ -1558,12 +1557,12 @@ end;
|
||||
-------------------------------------------------------------------------------}
|
||||
function ClearFile(const Filename: string; RaiseOnError: boolean): boolean;
|
||||
var
|
||||
fs: TFileStream;
|
||||
fs: TFileStreamUTF8;
|
||||
begin
|
||||
if FileExistsUTF8(Filename) then begin
|
||||
try
|
||||
InvalidateFileStateCache;
|
||||
fs:=TFileStream.Create(UTF8ToSys(Filename),fmOpenWrite);
|
||||
fs:=TFileStreamUTF8.Create(Filename,fmOpenWrite);
|
||||
fs.Size:=0;
|
||||
fs.Free;
|
||||
except
|
||||
@ -2447,12 +2446,12 @@ end;
|
||||
|
||||
function CreateEmptyFile(const Filename: string): boolean;
|
||||
var
|
||||
fs: TFileStream;
|
||||
fs: TFileStreamUTF8;
|
||||
begin
|
||||
Result:=false;
|
||||
try
|
||||
InvalidateFileStateCache;
|
||||
fs:=TFileStream.Create(UTF8ToSys(Filename),fmCreate);
|
||||
fs:=TFileStreamUTF8.Create(Filename,fmCreate);
|
||||
fs.Free;
|
||||
Result:=true;
|
||||
except
|
||||
@ -2462,7 +2461,7 @@ end;
|
||||
function CopyFileWithMethods(const SrcFilename, DestFilename: string;
|
||||
OnCopyError: TOnCopyErrorMethod; Data: TObject): boolean;
|
||||
var
|
||||
SrcFileStream, DestFileStream: TFileStream;
|
||||
SrcFileStream, DestFileStream: TFileStreamUTF8;
|
||||
{$IFdef MSWindows}
|
||||
OldAttr: Longint;
|
||||
{$ELSE}
|
||||
@ -2482,10 +2481,10 @@ begin
|
||||
//writeln('CopyFileWithMethods ',SrcFilename,' ',DestFilename);
|
||||
// copy file
|
||||
try
|
||||
SrcFileStream:=TFileStream.Create(UTF8ToSys(SrcFilename),fmOpenRead);
|
||||
SrcFileStream:=TFileStreamUTF8.Create(SrcFilename,fmOpenRead);
|
||||
try
|
||||
InvalidateFileStateCache;
|
||||
DestFileStream:=TFileStream.Create(UTF8ToSys(DestFilename),fmCreate);
|
||||
DestFileStream:=TFileStreamUTF8.Create(DestFilename,fmCreate);
|
||||
try
|
||||
DestFileStream.CopyFrom(SrcFileStream,SrcFileStream.Size);
|
||||
finally
|
||||
|
@ -41,7 +41,7 @@ interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, contnrs, LCLProc, Forms, Controls, Buttons, Dialogs,
|
||||
FileUtil, Laz2_XMLCfg, Graphics, ComCtrls, ExtCtrls, StdCtrls,
|
||||
FileUtil, Laz2_XMLCfg, lazutf8classes, Graphics, ComCtrls, ExtCtrls, StdCtrls,
|
||||
DefineTemplates, CodeToolManager,
|
||||
TextTools,
|
||||
TransferMacros, LazarusIDEStrConsts, LazConf, EnvironmentOpts, IDEProcs,
|
||||
@ -218,7 +218,7 @@ function CheckLazarusDirectoryQuality(ADirectory: string;
|
||||
end;
|
||||
|
||||
var
|
||||
sl: TStringList;
|
||||
sl: TStringListUTF8;
|
||||
VersionIncFile: String;
|
||||
Version: String;
|
||||
begin
|
||||
@ -238,7 +238,7 @@ begin
|
||||
if not SubFileExists('ide/lazarus.lpi',Result) then exit;
|
||||
VersionIncFile:=SetDirSeparators('ide/version.inc');
|
||||
if not SubFileExists(VersionIncFile,Result) then exit;
|
||||
sl:=TStringList.Create;
|
||||
sl:=TStringListUTF8.Create;
|
||||
try
|
||||
try
|
||||
sl.LoadFromFile(ADirectory+VersionIncFile);
|
||||
@ -656,7 +656,7 @@ function CheckFPCSrcDirQuality(ADirectory: string; out Note: string;
|
||||
|
||||
var
|
||||
VersionFile: String;
|
||||
sl: TStringList;
|
||||
sl: TStringListUTF8;
|
||||
i: Integer;
|
||||
VersionNr: String;
|
||||
ReleaseNr: String;
|
||||
@ -681,7 +681,7 @@ begin
|
||||
VersionFile:=ADirectory+'compiler'+PathDelim+'version.pas';
|
||||
if FileExistsCached(VersionFile) then
|
||||
begin
|
||||
sl:=TStringList.Create;
|
||||
sl:=TStringListUTF8.Create;
|
||||
try
|
||||
try
|
||||
sl.LoadFromFile(VersionFile);
|
||||
|
@ -46,7 +46,8 @@ interface
|
||||
{$endif}
|
||||
|
||||
uses
|
||||
SysUtils, Classes, InterfaceBase, FileUtil, LCLProc, DefineTemplates;
|
||||
SysUtils, Classes, InterfaceBase, FileUtil, lazutf8classes, LCLProc,
|
||||
DefineTemplates;
|
||||
|
||||
const
|
||||
LazarusVersionStr = {$I version.inc};
|
||||
@ -187,12 +188,12 @@ function CreateCompilerTestPascalFilename: string;
|
||||
|
||||
function CreateFile(const Filename: string): boolean;
|
||||
var
|
||||
fs: TFileStream;
|
||||
fs: TFileStreamUTF8;
|
||||
begin
|
||||
if FileExistsUTF8(Filename) then exit(true);
|
||||
Result:=false;
|
||||
try
|
||||
fs:=TFileStream.Create(UTF8ToSys(Filename),fmCreate);
|
||||
fs:=TFileStreamUTF8.Create(Filename,fmCreate);
|
||||
fs.Free;
|
||||
Result:=true;
|
||||
except
|
||||
|
12
ide/main.pp
12
ide/main.pp
@ -66,6 +66,7 @@ uses
|
||||
LCLProc, LCLMemManager, LCLType, LCLIntf, LConvEncoding, LMessages, ComCtrls,
|
||||
FileUtil, LResources, StdCtrls, Forms, Buttons, Menus, Controls, GraphType,
|
||||
HelpIntfs, Graphics, ExtCtrls, Dialogs, InterfaceBase, UTF8Process, LazLogger,
|
||||
lazutf8classes,
|
||||
// codetools
|
||||
FileProcs, CodeBeautifier, FindDeclarationTool, LinkScanner, BasicCodeTools,
|
||||
CodeToolsStructs, CodeToolManager, CodeCache, DefineTemplates,
|
||||
@ -12587,7 +12588,7 @@ procedure TMainIDE.DoExecuteRemoteControl;
|
||||
|
||||
var
|
||||
Filename: String;
|
||||
List: TStringList;
|
||||
List: TStringListUTF8;
|
||||
Files: TStrings;
|
||||
i: Integer;
|
||||
CmdShow: Boolean;
|
||||
@ -12596,12 +12597,12 @@ begin
|
||||
if FileExistsUTF8(Filename) and (FRemoteControlFileAge<>FileAgeUTF8(Filename))
|
||||
then begin
|
||||
// the control file exists and has changed
|
||||
List:=TStringList.Create;
|
||||
List:=TStringListUTF8.Create;
|
||||
Files:=nil;
|
||||
try
|
||||
// load and delete the file
|
||||
try
|
||||
List.LoadFromFile(UTF8ToSys(Filename));
|
||||
List.LoadFromFile(Filename);
|
||||
except
|
||||
DebugLn(['TMainIDE.DoExecuteRemoteControl reading file failed: ',Filename]);
|
||||
end;
|
||||
@ -13520,12 +13521,13 @@ end;
|
||||
|
||||
function TMainIDE.DoLoadMemoryStreamFromFile(MemStream: TMemoryStream;
|
||||
const AFilename:string): TModalResult;
|
||||
var FileStream: TFileStream;
|
||||
var
|
||||
FileStream: TFileStreamUTF8;
|
||||
ACaption,AText:string;
|
||||
begin
|
||||
repeat
|
||||
try
|
||||
FileStream:=TFileStream.Create(UTF8ToSys(AFilename),fmOpenRead);
|
||||
FileStream:=TFileStreamUTF8.Create(AFilename,fmOpenRead);
|
||||
try
|
||||
FileStream.Position:=0;
|
||||
MemStream.CopyFrom(FileStream,FileStream.Size);
|
||||
|
@ -5,8 +5,8 @@ unit ManageExamples;
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, FileUtil, ListFilterEdit, Forms, Controls, Graphics,
|
||||
Dialogs, StdCtrls, ExtCtrls, ButtonPanel, Buttons, EditBtn, LCLProc,
|
||||
Classes, SysUtils, FileUtil, lazutf8classes, ListFilterEdit, Forms, Controls,
|
||||
Graphics, Dialogs, StdCtrls, ExtCtrls, ButtonPanel, Buttons, EditBtn, LCLProc,
|
||||
IDEWindowIntf, LazIDEIntf, MainIntf, EnvironmentOpts, LazarusIDEStrConsts;
|
||||
|
||||
type
|
||||
@ -317,7 +317,6 @@ begin
|
||||
end;
|
||||
|
||||
// Project list selection changes. Adjust buttons.
|
||||
|
||||
procedure TManageExamplesForm.ProjectsListBoxSelectionChange(Sender: TObject; User: boolean);
|
||||
var
|
||||
HasSelected: Boolean;
|
||||
@ -337,7 +336,7 @@ begin
|
||||
ReadMe:=ExtractFilePath(ProjectsListBox.Items[i])+'README.txt';
|
||||
RealReadMe:=FindDiskFileCaseInsensitive(ReadMe);
|
||||
if RealReadMe <> '' then
|
||||
DescriptionMemo.Lines.LoadFromFile(RealReadMe)
|
||||
LoadStringsFromFileUTF8(DescriptionMemo.Lines,RealReadMe)
|
||||
else
|
||||
DescriptionMemo.Clear;
|
||||
Break;
|
||||
|
@ -34,8 +34,8 @@ unit ProjectIcon;
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, FileUtil, Laz2_XMLCfg, Process, LCLProc, Controls, Forms,
|
||||
CodeToolManager, CodeCache, LazConf, LResources, resource,
|
||||
Classes, SysUtils, FileUtil, Laz2_XMLCfg, lazutf8classes, Process, LCLProc,
|
||||
Controls, Forms, CodeToolManager, CodeCache, LazConf, LResources, resource,
|
||||
DialogProcs, groupiconresource, ProjectIntf, ProjectResourcesIntf;
|
||||
|
||||
type
|
||||
@ -220,7 +220,7 @@ begin
|
||||
// We need to restore data from the .ico file
|
||||
if FileExistsUTF8(FicoFileName) then
|
||||
begin
|
||||
AStream := TFileStream.Create(UTF8ToSys(FicoFileName), fmOpenRead);
|
||||
AStream := TFileStreamUTF8.Create(FicoFileName,fmOpenRead);
|
||||
try
|
||||
SetLength(NewData, AStream.Size);
|
||||
AStream.ReadBuffer(NewData[0], AStream.Size);
|
||||
|
@ -42,10 +42,10 @@ uses
|
||||
{$IFDEF IDE_MEM_CHECK}
|
||||
MemCheck,
|
||||
{$ENDIF}
|
||||
SynEditMouseCmds,
|
||||
Classes, SysUtils, Math, Controls, ExtendedNotebook, LCLProc, LCLType, LResources,
|
||||
LCLIntf, FileUtil, Forms, ComCtrls, Dialogs, StdCtrls, Graphics, Translations,
|
||||
ClipBrd, types, Extctrls, Menus, HelpIntfs, LConvEncoding, Messages, LazLoggerBase,
|
||||
SynEditMouseCmds, Classes, SysUtils, Math, Controls, ExtendedNotebook,
|
||||
LCLProc, LCLType, LResources, LCLIntf, FileUtil, Forms, ComCtrls, Dialogs,
|
||||
StdCtrls, Graphics, Translations, ClipBrd, types, Extctrls, Menus, HelpIntfs,
|
||||
LConvEncoding, Messages, LazLoggerBase, lazutf8classes,
|
||||
// codetools
|
||||
BasicCodeTools, CodeBeautifier, CodeToolManager, CodeCache, SourceLog,
|
||||
// synedit
|
||||
@ -59,10 +59,11 @@ uses
|
||||
SrcEditorIntf, MenuIntf, LazIDEIntf, PackageIntf, IDEHelpIntf, IDEImagesIntf,
|
||||
IDEWindowIntf, ProjectIntf,
|
||||
// IDE units
|
||||
IDEDialogs, LazarusIDEStrConsts, IDECommands, EditorOptions, EnvironmentOpts,
|
||||
WordCompletion, FindReplaceDialog, IDEProcs, IDEOptionDefs, IDEHelpManager,
|
||||
MacroPromptDlg, TransferMacros, CodeContextForm, SrcEditHintFrm, MsgView,
|
||||
InputHistory, CodeMacroPrompt, CodeTemplatesDlg, CodeToolsOptions,
|
||||
IDEDialogs, DialogProcs, LazarusIDEStrConsts, IDECommands, EditorOptions,
|
||||
EnvironmentOpts, WordCompletion, FindReplaceDialog, IDEProcs, IDEOptionDefs,
|
||||
IDEHelpManager, MacroPromptDlg, TransferMacros, CodeContextForm,
|
||||
SrcEditHintFrm, MsgView, InputHistory,
|
||||
CodeMacroPrompt, CodeTemplatesDlg, CodeToolsOptions,
|
||||
SortSelectionDlg, EncloseSelectionDlg, ConDef, InvertAssignTool,
|
||||
SourceEditProcs, SourceMarks, CharacterMapDlg, SearchFrm,
|
||||
FPDocHints,
|
||||
@ -9002,6 +9003,7 @@ end;
|
||||
procedure TSourceEditorManager.ReloadEditorOptions;
|
||||
var
|
||||
i: Integer;
|
||||
Filename: string;
|
||||
begin
|
||||
for i := FSourceWindowList.Count - 1 downto 0 do
|
||||
SourceWindows[i].ReloadEditorOptions;
|
||||
@ -9010,10 +9012,16 @@ begin
|
||||
// reload code templates
|
||||
with CodeTemplateModul do begin
|
||||
if FileExistsUTF8(EditorOpts.CodeTemplateFilename) then
|
||||
AutoCompleteList.LoadFromFile(UTF8ToSys(EditorOpts.CodeTemplateFilename))
|
||||
else
|
||||
if FileExistsUTF8('lazarus.dci') then
|
||||
AutoCompleteList.LoadFromFile(UTF8ToSys('lazarus.dci'));
|
||||
LoadStringsFromFileUTF8(AutoCompleteList,EditorOpts.CodeTemplateFilename)
|
||||
else begin
|
||||
Filename:=EnvironmentOptions.GetParsedLazarusDirectory+SetDirSeparators('ide/lazarus.dci');
|
||||
if FileExistsUTF8(Filename) then begin
|
||||
try
|
||||
LoadStringsFromFileUTF8(AutoCompleteList,Filename);
|
||||
except
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
IndentToTokenStart:=EditorOpts.CodeTemplateIndentToTokenStart;
|
||||
end;
|
||||
|
||||
@ -9614,6 +9622,8 @@ begin
|
||||
end;
|
||||
|
||||
constructor TSourceEditorManager.Create(AOwner: TComponent);
|
||||
var
|
||||
DCIFilename: String;
|
||||
begin
|
||||
inherited Create(AOwner);
|
||||
|
||||
@ -9645,11 +9655,14 @@ begin
|
||||
// code templates
|
||||
FCodeTemplateModul:=TSynEditAutoComplete.Create(Self);
|
||||
with FCodeTemplateModul do begin
|
||||
if FileExistsUTF8(EditorOpts.CodeTemplateFilename) then
|
||||
AutoCompleteList.LoadFromFile(UTF8ToSys(EditorOpts.CodeTemplateFilename))
|
||||
else
|
||||
if FileExistsUTF8('lazarus.dci') then
|
||||
AutoCompleteList.LoadFromFile(UTF8ToSys('lazarus.dci'));
|
||||
DCIFilename:=EditorOpts.CodeTemplateFilename;
|
||||
if not FileExistsCached(DCIFilename) then
|
||||
DCIFilename:=EnvironmentOptions.GetParsedLazarusDirectory+SetDirSeparators('ide/lazarus.dci');
|
||||
if FileExistsCached(DCIFilename) then
|
||||
try
|
||||
LoadStringsFromFileUTF8(AutoCompleteList,DCIFilename);
|
||||
except
|
||||
end;
|
||||
IndentToTokenStart := EditorOpts.CodeTemplateIndentToTokenStart;
|
||||
OnTokenNotFound := @OnCodeTemplateTokenNotFound;
|
||||
OnExecuteCompletion := @OnCodeTemplateExecuteCompletion;
|
||||
|
@ -39,8 +39,8 @@ unit PackageLinks;
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, Laz2_XMLCfg, FileProcs, CodeToolManager,
|
||||
CodeToolsStructs, LCLProc, FileUtil, AvgLvlTree, MacroIntf, PackageIntf,
|
||||
Classes, SysUtils, Laz2_XMLCfg, FileProcs, CodeToolManager, CodeToolsStructs,
|
||||
LCLProc, FileUtil, AvgLvlTree, lazutf8classes, MacroIntf, PackageIntf,
|
||||
IDEProcs, EnvironmentOpts, PackageDefs, LazConf;
|
||||
|
||||
const
|
||||
@ -421,7 +421,7 @@ var
|
||||
NewPkgName: string;
|
||||
PkgVersion: TPkgVersion;
|
||||
NewPkgLink: TPackageLink;
|
||||
sl: TStringList;
|
||||
sl: TStringListUTF8;
|
||||
CurFilename: String;
|
||||
NewFilename: string;
|
||||
begin
|
||||
@ -445,9 +445,9 @@ begin
|
||||
continue;
|
||||
end;
|
||||
NewFilename:='';
|
||||
sl:=TStringList.Create;
|
||||
sl:=TStringListUTF8.Create;
|
||||
try
|
||||
sl.LoadFromFile(UTF8ToSys(CurFilename));
|
||||
sl.LoadFromFile(CurFilename);
|
||||
if sl.Count<=0 then begin
|
||||
DebugLn('WARNING: suspicious pkg link file found (content): ',CurFilename);
|
||||
continue;
|
||||
|
@ -48,7 +48,7 @@ uses
|
||||
contnrs, StringHashList, Translations, LResources,
|
||||
// codetools
|
||||
CodeToolsConfig, CodeToolManager, CodeCache, CodeToolsStructs, BasicCodeTools,
|
||||
FileProcs, Laz2_XMLCfg,
|
||||
FileProcs, Laz2_XMLCfg, lazutf8classes,
|
||||
// IDE Interface
|
||||
SrcEditorIntf, NewItemIntf, ProjectIntf, PackageIntf, CompOptsIntf,
|
||||
MenuIntf, IDEWindowIntf, PropEdits, MacroIntf, LazIDEIntf,
|
||||
@ -627,7 +627,7 @@ var
|
||||
NewSource: String;
|
||||
UnitDirectives: String;
|
||||
IconLRSFilename: String;
|
||||
BinFileStream: TFileStream;
|
||||
BinFileStream: TFileStreamUTF8;
|
||||
BinMemStream: TMemoryStream;
|
||||
BinExt: String;
|
||||
ResourceType: String;
|
||||
@ -647,7 +647,7 @@ begin
|
||||
exit;
|
||||
end;
|
||||
try
|
||||
BinFileStream:=TFileStream.Create(UTF8ToSys(Params.IconFile),fmOpenRead);
|
||||
BinFileStream:=TFileStreamUTF8.Create(Params.IconFile,fmOpenRead);
|
||||
try
|
||||
BinMemStream:=TMemoryStream.Create;
|
||||
ResMemStream:=TMemoryStream.Create;
|
||||
|
@ -1,4 +1,3 @@
|
||||
{ $Id$ }
|
||||
{***************************************************************************
|
||||
* *
|
||||
* This source is free software; you can redistribute it and/or modify *
|
||||
@ -29,7 +28,7 @@ interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls,
|
||||
Buttons, FileUtil, IDEProcs, UFrmAddComponent;
|
||||
Buttons, FileUtil, lazutf8classes, IDEProcs, UFrmAddComponent;
|
||||
|
||||
Type
|
||||
TRComponent = class(TObject)
|
||||
@ -76,7 +75,7 @@ type
|
||||
function FindUnitName: String;
|
||||
private
|
||||
FLazPath: String;
|
||||
MyFile: TStringList;
|
||||
MyFile: TStringListUTF8;
|
||||
procedure SetLazPath(const AValue: String);
|
||||
public
|
||||
property LazPath: String read FLazPath write SetLazPath;
|
||||
@ -130,7 +129,7 @@ begin
|
||||
// load in and parse the source
|
||||
try
|
||||
MyFile.Clear;
|
||||
MyFile.LoadFromFile(UTF8ToSys(DlgLoad.Filename));
|
||||
MyFile.LoadFromFile(DlgLoad.Filename);
|
||||
except
|
||||
MessageDlg('Error loading unit: '+DlgLoad.Filename,mtError,[mbCancel],0);
|
||||
exit;
|
||||
@ -198,7 +197,7 @@ begin
|
||||
MakeUses;
|
||||
MakeRegister;
|
||||
try
|
||||
MyFile.SaveToFile(UTF8ToSys(FLazPath+'components/custom/customidecomps.pas'));
|
||||
MyFile.SaveToFile(FLazPath+'components/custom/customidecomps.pas');
|
||||
except
|
||||
MessageDlg('Error saving customidecomps.pas!',mtError,[mbCancel],0);
|
||||
exit;
|
||||
@ -210,7 +209,7 @@ end;
|
||||
|
||||
procedure TFrmComponentMan.FrmMainCREATE(Sender: TObject);
|
||||
begin
|
||||
MyFile := TStringList.Create;
|
||||
MyFile := TStringListUTF8.Create;
|
||||
Caption:='Custom Component Manager (No packages!)';
|
||||
Label1.Caption:='Installed Custom Components';
|
||||
end;
|
||||
@ -233,7 +232,7 @@ begin
|
||||
RegisterFilename:=
|
||||
AppendPathDelim(FLazPath)+'components/custom/customidecomps.pas';
|
||||
try
|
||||
MyFile.LoadFromFile(UTF8ToSys(RegisterFilename));
|
||||
MyFile.LoadFromFile(RegisterFilename);
|
||||
except
|
||||
on E: Exception do begin
|
||||
if messagedlg('Error loading '+RegisterFilename+': '+E.Message+#13#10+
|
||||
@ -258,7 +257,7 @@ begin
|
||||
MyFile.Clear;
|
||||
exit;
|
||||
end;
|
||||
MyFile.SaveToFile(UTF8ToSys(ChangeFileExt(RegisterFilename,'.orig')));
|
||||
MyFile.SaveToFile(ChangeFileExt(RegisterFilename,'.orig'));
|
||||
end;
|
||||
|
||||
// okay got a good file here...
|
||||
|
Loading…
Reference in New Issue
Block a user