From f7d46bbd2e61f64ccf4d77c3f7898dd941284933 Mon Sep 17 00:00:00 2001 From: mattias Date: Mon, 24 Jan 2005 02:42:34 +0000 Subject: [PATCH] fixed search path to cmd line param git-svn-id: trunk@6673 - --- ide/compileroptions.pp | 68 +++++++++++++++++-------------------- ide/compileroptionsdlg.pp | 2 +- ide/lazarusidestrconsts.pas | 3 ++ ide/main.pp | 10 ++++-- 4 files changed, 42 insertions(+), 41 deletions(-) diff --git a/ide/compileroptions.pp b/ide/compileroptions.pp index c974a35f0c..d0dcb81ff2 100644 --- a/ide/compileroptions.pp +++ b/ide/compileroptions.pp @@ -504,47 +504,31 @@ begin end; function ConvertSearchPathToCmdLine( - const switch, paths: String): String; + const Switch, Paths: String): String; var - tempsw, SS, Delim: String; - M: Integer; + StartPos: Integer; + l: Integer; + EndPos: LongInt; begin - Delim := ';'; + if Switch='' then + RaiseException('ConvertSearchPathToCmdLine no Switch'); + Result := ''; + if (Paths = '') then exit; - if (switch = '') or (paths = '') then - begin - Result := ''; - Exit; - end; - - tempsw := ''; - SS := paths; - - repeat - M := Pos (Delim, SS); - - if (M = 0) then - begin - if (tempsw <> '') then - tempsw := tempsw + ' '; - tempsw := tempsw + PrepareCmdLineOption(switch + SS); - Break; - end - else if (M = 1) then - begin - SS := Copy (SS, M + 1, Length(SS)); - Continue; - end - else - begin - if (tempsw <> '') then - tempsw := tempsw + ' '; - tempsw := tempsw + PrepareCmdLineOption(switch + Copy (SS, 1, M - 1)); - SS := Copy (SS, M + 1, Length(SS)); + l:=length(Paths); + StartPos:=1; + while StartPos<=l do begin + while (StartPos<=l) and (Paths[StartPos]=' ') do inc(StartPos); + EndPos:=StartPos; + while (EndPos<=l) and (Paths[EndPos]<>';') do inc(EndPos); + if StartPos'' then + Result:=Result+' '; + Result:=Result + +PrepareCmdLineOption(Switch + copy(Paths,StartPos,EndPos-StartPos)); end; - until (SS = '') or (M = 0); - - Result := tempsw; + StartPos:=EndPos+1; + end; end; function ConvertOptionsToCmdLine(const Delim, Switch, @@ -1249,13 +1233,22 @@ var begin // current path CurrentPath:=ParsedOpts.GetParsedValue(Option); + //if Option=pcosUnitPath then + // debugln('TBaseCompilerOptions.GetParsedPath GetParsedValue ',dbgsName(Self),' RelativeToBaseDir=',dbgs(RelativeToBaseDir),' CurrentPath="',CurrentPath,'"'); + if (not RelativeToBaseDir) then CreateAbsolutePath(CurrentPath,BaseDirectory); + //if Option=pcosUnitPath then + // debugln('TBaseCompilerOptions.GetParsedPath CreateAbsolutePath ',dbgsName(Self),' CurrentPath="',CurrentPath,'"'); // inherited path InheritedPath:=GetInheritedOption(InheritedOption,RelativeToBaseDir); + //if Option=pcosUnitPath then + // debugln('TBaseCompilerOptions.GetParsedPath Inherited ',dbgsName(Self),' InheritedPath="',InheritedPath,'"'); Result:=MergeSearchPaths(CurrentPath,InheritedPath); + //if Option=pcosUnitPath then + // debugln('TBaseCompilerOptions.GetParsedPath Total ',dbgsName(Self),' CurrentPath="',CurrentPath,'"'); end; function TBaseCompilerOptions.GetCustomOptions: string; @@ -1774,6 +1767,7 @@ Processor specific options: // unit path CurUnitPath:=GetUnitPath(true); + debugln('TBaseCompilerOptions.MakeOptionsString A ',dbgsName(Self),' CurUnitPath="',CurUnitPath,'"'); // always add the current directory to the unit path, so that the compiler // checks for changed files in the directory CurUnitPath:=CurUnitPath+';.'; diff --git a/ide/compileroptionsdlg.pp b/ide/compileroptionsdlg.pp index dd17142db2..aed0654b60 100644 --- a/ide/compileroptionsdlg.pp +++ b/ide/compileroptionsdlg.pp @@ -462,7 +462,7 @@ begin PutCompilerOptions(true); CurOptions := CompilerOpts.MakeOptionsString(nil, CompilerOpts.DefaultMakeOptionsFlags); - DebugLn('CompilerOpts.MakeOptionsString: ' + CurOptions); + //DebugLn('CompilerOpts.MakeOptionsString: ' + CurOptions); ShowCompilerOptionsDialog(CurOptions); end; diff --git a/ide/lazarusidestrconsts.pas b/ide/lazarusidestrconsts.pas index 20721a3deb..a5585c1aee 100644 --- a/ide/lazarusidestrconsts.pas +++ b/ide/lazarusidestrconsts.pas @@ -505,6 +505,9 @@ resourcestring +'unit with the name %s%s%s. Pascal identifiers must be unique.'; lisSeeMessages = 'See messages.'; lisError = 'Error: '; + lisSaveChanges = 'Save changes?'; + lisSaveFileBeforeClosingForm = + 'Save file %s%s%s%sbefore closing form %s%s%s?'; lisUnableToRenameFormInSource = 'Unable to rename form in source.'; lisSorryNotImplementedYet = 'Sorry, not implemented yet'; lisUnableToFindMethodPlzFixTheErrorShownInTheMessage = 'Unable to find ' diff --git a/ide/main.pp b/ide/main.pp index 34dd337d95..34e8ff8a33 100644 --- a/ide/main.pp +++ b/ide/main.pp @@ -10375,9 +10375,10 @@ begin GetDesignerUnit(ADesigner,ASrcEdit,AnUnitInfo); if AnUnitInfo.NeedsSaveToDisk then begin - case MessageDlg('Save changes?', - 'Save file "'+AnUnitInfo.Filename+'"'#13 - +'before closing form "'+ADesigner.LookupRoot.Name+'"?', + case MessageDlg(lisSaveChanges, + Format(lisSaveFileBeforeClosingForm, ['"', + AnUnitInfo.Filename, '"', #13, '"', + ADesigner.LookupRoot.Name, '"']), mtConfirmation,[mbYes,mbNo,mbCancel],0) of mrYes: begin if DoSaveEditorFile(AnUnitInfo.EditorIndex,[sfCheckAmbigiousFiles])<>mrOk @@ -11377,6 +11378,9 @@ end. { ============================================================================= $Log$ + Revision 1.837 2005/01/24 02:42:34 mattias + fixed search path to cmd line param + Revision 1.836 2005/01/21 22:08:11 micha implement restored size, let lazarus ide store restored size