IDE: compiler options dlg: omit checking macros

git-svn-id: trunk@13202 -
This commit is contained in:
mattias 2007-12-07 13:05:21 +00:00
parent 01a956df63
commit 954c637752
3 changed files with 37 additions and 18 deletions

View File

@ -460,6 +460,9 @@ begin
FListing.TimeStamp:=Pool.TimeStamp; FListing.TimeStamp:=Pool.TimeStamp;
if Directory='' then exit;// virtual directory if Directory='' then exit;// virtual directory
// Note: do not add a 'if not DirectoryExists then exit'. This will not
// work on automounted directories. You must use FindFirst.
// read the directory // read the directory
WorkingListing:=nil; WorkingListing:=nil;
WorkingListingCapacity:=0; WorkingListingCapacity:=0;

View File

@ -207,7 +207,6 @@ function TCheckCompilerOptsDlg.CheckSpecialCharsInPath(const Title, Path: string
end; end;
var var
i: Integer;
Warning: String; Warning: String;
ErrorMsg: String; ErrorMsg: String;
HasChars: TCCOSpecialChars; HasChars: TCCOSpecialChars;
@ -815,6 +814,9 @@ begin
end; end;
end; end;
// check for non existing paths
CompilerFilename:=Options.ParsedOpts.GetParsedValue(pcosCompilerPath); CompilerFilename:=Options.ParsedOpts.GetParsedValue(pcosCompilerPath);
// check compiler filename // check compiler filename

View File

@ -40,7 +40,7 @@ uses
Forms, Classes, Math, LCLProc, SysUtils, InterfaceBase, Forms, Classes, Math, LCLProc, SysUtils, InterfaceBase,
ComCtrls, Buttons, StdCtrls, ExtCtrls, ComCtrls, Buttons, StdCtrls, ExtCtrls,
Graphics, LResources, FileUtil, Dialogs, Controls, GraphType, Graphics, LResources, FileUtil, Dialogs, Controls, GraphType,
ProjectIntf, IDEWindowIntf, IDEContextHelpEdit, MacroIntf, ProjectIntf, IDEWindowIntf, IDEContextHelpEdit,
PathEditorDlg, LazarusIDEStrConsts, IDEOptionDefs, LazConf, IDEProcs, PathEditorDlg, LazarusIDEStrConsts, IDEOptionDefs, LazConf, IDEProcs,
IDEImagesIntf, ShowCompilerOpts, Project, PackageDefs, CompilerOptions, IDEImagesIntf, ShowCompilerOpts, Project, PackageDefs, CompilerOptions,
CheckCompilerOpts; CheckCompilerOpts;
@ -1555,7 +1555,8 @@ begin
repeat repeat
//DebugLn(['CheckSearchPath ',ExpandedPath,' ',p,' ',length(ExpandedPath)]); //DebugLn(['CheckSearchPath ',ExpandedPath,' ',p,' ',length(ExpandedPath)]);
CurPath:=GetNextDirectoryInSearchPath(ExpandedPath,p); CurPath:=GetNextDirectoryInSearchPath(ExpandedPath,p);
if CurPath<>'' then begin if (CurPath<>'') and (not IDEMacros.StrHasMacros(CurPath))
and (FilenameIsAbsolute(CurPath)) then begin
if not DirPathExistsCached(CurPath) then begin if not DirPathExistsCached(CurPath) then begin
if MessageDlg('Warning','The '+Context+' contains a not existing directory:'#13 if MessageDlg('Warning','The '+Context+' contains a not existing directory:'#13
+CurPath, +CurPath,
@ -1566,6 +1567,7 @@ begin
end; end;
// check for special characters // check for special characters
if (not IDEMacros.StrHasMacros(CurPath)) then begin
FindSpecialCharsInPath(ExpandedPath,HasChars); FindSpecialCharsInPath(ExpandedPath,HasChars);
if ord(Level)<=ord(ccomlWarning) then begin if ord(Level)<=ord(ccomlWarning) then begin
if ord(Level)>=ord(ccomlErrors) then begin if ord(Level)>=ord(ccomlErrors) then begin
@ -1578,6 +1580,7 @@ begin
mtWarning,[mbOk,mbCancel],0) <> mrOk then exit; mtWarning,[mbOk,mbCancel],0) <> mrOk then exit;
end; end;
end; end;
end;
Result:=true; Result:=true;
end; end;
@ -1636,6 +1639,17 @@ begin
end; end;
procedure TfrmCompilerOptions.PathEditBtnExecuted(Sender: TObject); procedure TfrmCompilerOptions.PathEditBtnExecuted(Sender: TObject);
function CheckPath(const Context, NewPath: string): boolean;
var
ExpandedPath: String;
BaseDir: String;
begin
BaseDir:=CompilerOpts.BaseDirectory;
ExpandedPath:=TrimSearchPath(NewPath,BaseDir);
Result:=CheckSearchPath(Context,ExpandedPath,ccomlHints);
end;
var AButton: TPathEditorButton; var AButton: TPathEditorButton;
NewPath: string; NewPath: string;
begin begin
@ -1646,23 +1660,23 @@ begin
if CompilerOpts<>nil then if CompilerOpts<>nil then
NewPath:=CompilerOpts.ShortenPath(NewPath,false); NewPath:=CompilerOpts.ShortenPath(NewPath,false);
if AButton=OtherUnitsPathEditBtn then begin if AButton=OtherUnitsPathEditBtn then begin
if CheckSearchPath(lblOtherUnits.Caption,NewPath,ccomlHints) then if CheckPath(lblOtherUnits.Caption,NewPath) then
edtOtherUnits.Text:=NewPath; edtOtherUnits.Text:=NewPath;
end else end else
if AButton=IncludeFilesPathEditBtn then begin if AButton=IncludeFilesPathEditBtn then begin
if CheckSearchPath(lblIncludeFiles.Caption,NewPath,ccomlHints) then if CheckPath(lblIncludeFiles.Caption,NewPath) then
edtIncludeFiles.Text:=NewPath; edtIncludeFiles.Text:=NewPath;
end else end else
if AButton=OtherSourcesPathEditBtn then begin if AButton=OtherSourcesPathEditBtn then begin
if CheckSearchPath(lblOtherSources.Caption,NewPath,ccomlHints) then if CheckPath(lblOtherSources.Caption,NewPath) then
edtOtherSources.Text:=NewPath; edtOtherSources.Text:=NewPath;
end else end else
if AButton=LibrariesPathEditBtn then begin if AButton=LibrariesPathEditBtn then begin
if CheckSearchPath(lblLibraries.Caption,NewPath,ccomlHints) then if CheckPath(lblLibraries.Caption,NewPath) then
edtLibraries.Text:=NewPath; edtLibraries.Text:=NewPath;
end else end else
if AButton=DebugPathEditBtn then begin if AButton=DebugPathEditBtn then begin
if CheckSearchPath(lblDebugPath.Caption,NewPath,ccomlHints) then if CheckPath(lblDebugPath.Caption,NewPath) then
edtDebugPath.Text:=NewPath; edtDebugPath.Text:=NewPath;
end; end;
end; end;