mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-07 20:41:37 +02:00
IDE: when copying secondary configs create the primary config directory first
git-svn-id: trunk@37796 -
This commit is contained in:
parent
51db64a5cb
commit
335676643d
@ -79,7 +79,7 @@ function CompareLazarusVersion(V1, V2: string): integer;
|
||||
}
|
||||
function GetPrimaryConfigPath: String;
|
||||
function GetSecondaryConfigPath: String;
|
||||
procedure CreatePrimaryConfigPath;
|
||||
function CreatePrimaryConfigPath: boolean;
|
||||
procedure SetPrimaryConfigPath(const NewValue: String);
|
||||
procedure SetSecondaryConfigPath(const NewValue: String);
|
||||
procedure CopySecondaryConfigFile(const ShortFilename: String);
|
||||
@ -295,9 +295,9 @@ end;
|
||||
{---------------------------------------------------------------------------
|
||||
createPrimaryConfigPath procedure
|
||||
---------------------------------------------------------------------------}
|
||||
procedure CreatePrimaryConfigPath;
|
||||
function CreatePrimaryConfigPath: boolean;
|
||||
begin
|
||||
CreateDirUTF8(GetPrimaryConfigPath);
|
||||
Result:=ForceDirectoriesUTF8(GetPrimaryConfigPath);
|
||||
end;
|
||||
|
||||
{---------------------------------------------------------------------------
|
||||
@ -330,8 +330,14 @@ begin
|
||||
SecondaryFilename:=AppendPathDelim(GetSecondaryConfigPath)+ShortFilename;
|
||||
if (not FileExistsUTF8(PrimaryFilename))
|
||||
and (FileExistsUTF8(SecondaryFilename)) then begin
|
||||
if not CopyFile(SecondaryFilename,PrimaryFilename) then
|
||||
debugln(['WARNING: unable to copy config "',SecondaryFilename,'" to "',SecondaryFilename,'"']);
|
||||
if not CreatePrimaryConfigPath then begin
|
||||
debugln(['WARNING: unable to create primary config directory "',GetPrimaryConfigPath,'"']);
|
||||
exit;
|
||||
end;
|
||||
if not CopyFile(SecondaryFilename,PrimaryFilename) then begin
|
||||
debugln(['WARNING: unable to copy config "',SecondaryFilename,'" to "',PrimaryFilename,'"']);
|
||||
exit;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user