mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-03 21:38:21 +02:00
IDE: compiler output path single . is now kept, bug #7695
git-svn-id: trunk@10131 -
This commit is contained in:
parent
9405bf0098
commit
83cc6976b1
@ -80,7 +80,8 @@ function FilenameIsTrimmed(StartPos: PChar; NameLen: integer): boolean;
|
||||
function TrimFilename(const AFilename: string): string;
|
||||
function CleanAndExpandFilename(const Filename: string): string;
|
||||
function CleanAndExpandDirectory(const Filename: string): string;
|
||||
function CreateRelativePath(const Filename, BaseDirectory: string): string;
|
||||
function CreateRelativePath(const Filename, BaseDirectory: string;
|
||||
UsePointDirectory: boolean = false): string;
|
||||
function FileIsInPath(const Filename, Path: string): boolean;
|
||||
function AppendPathDelim(const Path: string): string;
|
||||
function ChompPathDelim(const Path: string): string;
|
||||
@ -693,7 +694,7 @@ begin
|
||||
// check for double path delimiter
|
||||
if (StartPos[i]=PathDelim) then exit;
|
||||
|
||||
if StartPos[i]='.' then begin
|
||||
if (StartPos[i]='.') and (i>0) then begin
|
||||
inc(i);
|
||||
// check /./ or /. at end
|
||||
if (StartPos[i]=PathDelim) or (i=NameLen) then exit;
|
||||
@ -858,7 +859,8 @@ begin
|
||||
Result:=AppendPathDelim(CleanAndExpandFilename(Filename));
|
||||
end;
|
||||
|
||||
function CreateRelativePath(const Filename, BaseDirectory: string): string;
|
||||
function CreateRelativePath(const Filename, BaseDirectory: string;
|
||||
UsePointDirectory: boolean): string;
|
||||
var
|
||||
FileNameLength: Integer;
|
||||
BaseDirLen: Integer;
|
||||
@ -874,7 +876,7 @@ begin
|
||||
if (BaseDirectory='') or (Filename='') then exit;
|
||||
// check for different windows file drives
|
||||
if (CompareText(ExtractFileDrive(Filename),
|
||||
ExtractFileDrive(BaseDirectory))<>0)
|
||||
ExtractFileDrive(BaseDirectory))<>0)
|
||||
then
|
||||
exit;
|
||||
|
||||
@ -934,6 +936,10 @@ begin
|
||||
end;
|
||||
if FileNameRestLen>0 then
|
||||
Move(Filename[SamePos+1],Result[ResultPos],FileNameRestLen);
|
||||
|
||||
// use '.' for an Filename=BaseDirectory
|
||||
if (Result='') and (Filename<>'') and UsePointDirectory then
|
||||
Result:='.';
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
|
@ -2154,7 +2154,7 @@ Processor specific options:
|
||||
if UnitOutputDirectory<>'' then begin
|
||||
CurOutputDir:=ParsedOpts.GetParsedValue(pcosOutputDir);
|
||||
if not (cclAbsolutePaths in Flags) then
|
||||
CurOutputDir:=CreateRelativePath(CurOutputDir,BaseDirectory);
|
||||
CurOutputDir:=CreateRelativePath(CurOutputDir,BaseDirectory,true);
|
||||
end else
|
||||
CurOutputDir:='';
|
||||
if CurOutputDir<>'' then
|
||||
@ -2826,7 +2826,7 @@ begin
|
||||
else if Option in ParsedCompilerDirectories then begin
|
||||
// make directory absolute
|
||||
s:=TrimFilename(s);
|
||||
if (s='') or (not FilenameIsAbsolute(s))
|
||||
if ((s='') or (not FilenameIsAbsolute(s)))
|
||||
and (Option<>pcosBaseDir) then begin
|
||||
if PlatformIndependent then
|
||||
BaseDirectory:=GetParsedPIValue(pcosBaseDir)
|
||||
|
@ -87,7 +87,8 @@ function FilenameIsMatching(const Mask, Filename: string;
|
||||
function ConvertSpecialFileChars(const Filename: string): string;
|
||||
function FilenameIsPascalSource(const Filename: string): boolean;
|
||||
function FilenameIsFormText(const Filename: string): boolean;
|
||||
function CreateRelativePath(const Filename, BaseDirectory: string): string;
|
||||
function CreateRelativePath(const Filename, BaseDirectory: string;
|
||||
UsePointDirectory: boolean = false): string;
|
||||
function SwitchPathDelims(const Filename: string; Switch: boolean): string;
|
||||
function ChompEndNumber(const s: string): string;
|
||||
|
||||
@ -640,9 +641,10 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
function CreateRelativePath(const Filename, BaseDirectory: string): string;
|
||||
function CreateRelativePath(const Filename, BaseDirectory: string;
|
||||
UsePointDirectory: boolean): string;
|
||||
begin
|
||||
Result:=FileProcs.CreateRelativePath(Filename,BaseDirectory);
|
||||
Result:=FileProcs.CreateRelativePath(Filename,BaseDirectory,UsePointDirectory);
|
||||
end;
|
||||
|
||||
function CreateRelativeSearchPath(const SearchPath, BaseDirectory: string
|
||||
|
@ -2470,9 +2470,7 @@ begin
|
||||
DoExtractProcFromSelection;
|
||||
|
||||
ecToggleMessages:
|
||||
{$message warning TODO: toggle back to previously focused window?}
|
||||
{ DoShowMessageView does not bring messages view to top, source editor
|
||||
is more important there }
|
||||
// user used shortcut/menu item to show the window, so focusing is ok.
|
||||
MessagesView.EnsureVisible;
|
||||
|
||||
ecToggleCodeExpl:
|
||||
@ -4101,7 +4099,7 @@ begin
|
||||
AncestorInstance:=AncestorUnit.Component
|
||||
else
|
||||
AncestorInstance:=nil;
|
||||
DebugLn(['TMainIDE.DoSaveUnitComponent AncestorInstance=',dbgsName(AncestorInstance)]);
|
||||
//DebugLn(['TMainIDE.DoSaveUnitComponent AncestorInstance=',dbgsName(AncestorInstance)]);
|
||||
Writer.WriteDescendent(AnUnitInfo.Component,AncestorInstance);
|
||||
if DestroyDriver then Writer.Driver.Free;
|
||||
FreeAndNil(Writer);
|
||||
|
@ -1335,7 +1335,8 @@ begin
|
||||
Include(FStates,pgsChangingItemIndex);
|
||||
if (FItemIndex>=0) and (FItemIndex<FRows.Count) then
|
||||
Rows[FItemIndex].Editor.Deactivate;
|
||||
SetCaptureControl(nil);
|
||||
if CanFocus then
|
||||
SetCaptureControl(nil);
|
||||
|
||||
FItemIndex:=NewIndex;
|
||||
if FCurrentEdit<>nil then begin
|
||||
@ -1353,8 +1354,9 @@ begin
|
||||
NewRow:=Rows[NewIndex];
|
||||
|
||||
ScrollToItem(NewIndex);
|
||||
|
||||
NewRow.Editor.Activate;
|
||||
|
||||
if CanFocus then
|
||||
NewRow.Editor.Activate;
|
||||
if paDialog in NewRow.Editor.GetAttributes then begin
|
||||
FCurrentButton:=ValueButton;
|
||||
FCurrentButton.Visible:=true;
|
||||
@ -1392,7 +1394,8 @@ begin
|
||||
FCurrentEdit.Visible:=true;
|
||||
if (FDragging=false) and (FCurrentEdit.Showing)
|
||||
and FCurrentEdit.Enabled
|
||||
and (not NewRow.IsReadOnly) then begin
|
||||
and (not NewRow.IsReadOnly)
|
||||
and CanFocus then begin
|
||||
if (Column=oipgcValue) then
|
||||
FCurrentEdit.SetFocus
|
||||
else
|
||||
|
@ -1185,10 +1185,9 @@ Begin
|
||||
if (AWinControl<>nil) then begin
|
||||
if (AWinControl=Self)
|
||||
or (GetParentForm(AWinControl)<>Self)
|
||||
or ((not (csLoading in ComponentState))
|
||||
and (not AWinControl.CanFocus))
|
||||
or ((not (csLoading in ComponentState)) and (not AWinControl.CanFocus))
|
||||
then begin
|
||||
DebugLn('TCustomForm.SetActiveControl ',DbgSName(Self),' AWinControl=',DbgSName(AWinControl),' GetParentForm(AWinControl)=',DbgSName(GetParentForm(AWinControl)),' csLoading=',dbgs(csLoading in ComponentState),' AWinControl.CanFocus=',dbgs((AWinControl<>nil) and AWinControl.CanFocus));
|
||||
DebugLn('TCustomForm.SetActiveControl ',DbgSName(Self),' AWinControl=',DbgSName(AWinControl),' GetParentForm(AWinControl)=',DbgSName(GetParentForm(AWinControl)),' csLoading=',dbgs(csLoading in ComponentState),' AWinControl.CanFocus=',dbgs((AWinControl<>nil) and AWinControl.CanFocus),' IsControlVisible=',dbgs((AWinControl<>nil) and AWinControl.IsControlVisible),' Enabled=',dbgs((AWinControl<>nil) and AWinControl.Enabled),' GetParentForm(AWinControl)=',DbgSName(GetParentForm(AWinControl)));
|
||||
{$IFDEF VerboseFocus}
|
||||
RaiseGDBException(SCannotFocus);
|
||||
{$ELSE}
|
||||
|
@ -185,8 +185,9 @@ function TrimFilename(const AFilename: string): string;
|
||||
|
||||
'.':
|
||||
if (i=1) or (TheFilename[i-1]=PathDelim) then begin
|
||||
// check for . and .. directories
|
||||
if (i=l) or (TheFilename[i+1]=PathDelim) then exit;
|
||||
// check for . directories
|
||||
if (TheFilename[i+1]=PathDelim) or ((i=l) and (i>1)) then exit;
|
||||
// check for .. directories
|
||||
if (TheFilename[i+1]='.')
|
||||
and ((i=l-1) or (TheFilename[i+2]=PathDelim)) then exit;
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user