IDE: unified Primary and Secondary config path functions for unix and windows, they were the same after fixing issue

git-svn-id: trunk@17813 -
This commit is contained in:
vincents 2008-12-12 14:53:33 +00:00
parent 11bfd5f754
commit ffdbc27e0e
3 changed files with 46 additions and 88 deletions

View File

@ -56,52 +56,6 @@ const
'~/lazarus'
);
var
PrimaryConfigPath,
SecondaryConfigPath: string;
{---------------------------------------------------------------------------
getPrimaryConfigPath function
---------------------------------------------------------------------------}
function GetPrimaryConfigPath: String;
begin
Result := PrimaryConfigPath;
end;
{---------------------------------------------------------------------------
getSecondaryConfigPath function
---------------------------------------------------------------------------}
function GetSecondaryConfigPath: String;
begin
Result := SecondaryConfigPath;
end;
{---------------------------------------------------------------------------
createPrimaryConfigPath function
---------------------------------------------------------------------------}
procedure CreatePrimaryConfigPath;
begin
CreateDirUTF8(GetPrimaryConfigPath);
end;
{---------------------------------------------------------------------------
SetPrimaryConfigPath procedure
---------------------------------------------------------------------------}
procedure SetPrimaryConfigPath(const NewValue: String);
begin
debugln('SetPrimaryConfigPath NewValue="',NewValue,'" -> "',ExpandFileNameUTF8(NewValue),'"');
PrimaryConfigPath:=ExpandFileNameUTF8(NewValue);
end;
{---------------------------------------------------------------------------
SetSecondaryConfigPath procedure
---------------------------------------------------------------------------}
procedure SetSecondaryConfigPath(const NewValue: String);
begin
debugln('SetSecondaryConfigPath NewValue="',NewValue,'" -> "',ExpandFileNameUTF8(NewValue),'"');
SecondaryConfigPath:=ExpandFileNameUTF8(NewValue);
end;
{---------------------------------------------------------------------------
function FindDefaultCompilerPath: string;
---------------------------------------------------------------------------}

View File

@ -35,8 +35,6 @@ const
var
DefaultDrive: String;
PrimaryConfigPath,
SecondaryConfigPath: string;
DefaultFPCTarget,
DefaultFPCVersion : string;
@ -44,46 +42,6 @@ procedure GetDefaultLCLLibPaths(List: TStrings);
begin
end;
{---------------------------------------------------------------------------
getPrimaryConfigPath function
---------------------------------------------------------------------------}
function GetPrimaryConfigPath: String;
begin
Result := PrimaryConfigPath;
end;
{---------------------------------------------------------------------------
getSecondaryConfigPath function
---------------------------------------------------------------------------}
function GetSecondaryConfigPath: String;
begin
Result := SecondaryConfigPath;
end;
{---------------------------------------------------------------------------
createPrimaryConfigPath procedure
---------------------------------------------------------------------------}
procedure CreatePrimaryConfigPath;
begin
CreateDirUTF8(GetPrimaryConfigPath);
end;
{---------------------------------------------------------------------------
SetPrimaryConfigPath procedure
---------------------------------------------------------------------------}
procedure SetPrimaryConfigPath(const NewValue: String);
begin
PrimaryConfigPath := NewValue;
end;
{---------------------------------------------------------------------------
SetSecondaryConfigPath procedure
---------------------------------------------------------------------------}
procedure SetSecondaryConfigPath(const NewValue: String);
begin
SecondaryConfigPath := NewValue;
end;
type
TGetFileListProc = procedure (List: TStrings);

View File

@ -137,6 +137,10 @@ const
implementation
var
PrimaryConfigPath,
SecondaryConfigPath: string;
{$I lazconf.inc}
procedure AddFilenameToList(List: TStrings; const Filename: string;
@ -233,6 +237,48 @@ begin
List.Free;
end;
{---------------------------------------------------------------------------
getPrimaryConfigPath function
---------------------------------------------------------------------------}
function GetPrimaryConfigPath: String;
begin
Result := PrimaryConfigPath;
end;
{---------------------------------------------------------------------------
getSecondaryConfigPath function
---------------------------------------------------------------------------}
function GetSecondaryConfigPath: String;
begin
Result := SecondaryConfigPath;
end;
{---------------------------------------------------------------------------
createPrimaryConfigPath procedure
---------------------------------------------------------------------------}
procedure CreatePrimaryConfigPath;
begin
CreateDirUTF8(GetPrimaryConfigPath);
end;
{---------------------------------------------------------------------------
SetPrimaryConfigPath procedure
---------------------------------------------------------------------------}
procedure SetPrimaryConfigPath(const NewValue: String);
begin
debugln('SetPrimaryConfigPath NewValue="',NewValue,'" -> "',ExpandFileNameUTF8(NewValue),'"');
PrimaryConfigPath := ExpandFileNameUTF8(NewValue);
end;
{---------------------------------------------------------------------------
SetSecondaryConfigPath procedure
---------------------------------------------------------------------------}
procedure SetSecondaryConfigPath(const NewValue: String);
begin
debugln('SetSecondaryConfigPath NewValue="',NewValue,'" -> "',ExpandFileNameUTF8(NewValue),'"');
SecondaryConfigPath := ExpandFileNameUTF8(NewValue);
end;
{---------------------------------------------------------------------------
CopySecondaryConfigFile procedure
---------------------------------------------------------------------------}