ide: don't show warning is project path contains spaces (issue #0014478)

git-svn-id: trunk@21658 -
This commit is contained in:
paul 2009-09-12 07:58:06 +00:00
parent 5f5e0ff648
commit f5264eb600
2 changed files with 22 additions and 24 deletions

View File

@ -118,7 +118,6 @@ var
type type
TCCOSpecialCharType = ( TCCOSpecialCharType = (
ccoscSpaces,
ccoscNonASCII, ccoscNonASCII,
ccoscWrongPathDelim, ccoscWrongPathDelim,
ccoscUnusualChars, ccoscUnusualChars,
@ -139,12 +138,12 @@ procedure FindSpecialCharsInPath(const Path: string; out
var var
i: Integer; i: Integer;
begin begin
HasChars:=[]; HasChars := [];
for i:=1 to length(Path) do begin for i := 1 to length(Path) do
begin
case Path[i] of case Path[i] of
#10,#13: Include(HasChars,ccoscNewLine); #10,#13: Include(HasChars,ccoscNewLine);
#0..#8,#11,#12,#14..#31: Include(HasChars,ccoscSpecialChars); #0..#9,#11,#12,#14..#31: Include(HasChars,ccoscSpecialChars);
#9,' ': Include(HasChars,ccoscSpaces);
'/','\': if Path[i]<>PathDelim then Include(HasChars,ccoscWrongPathDelim); '/','\': if Path[i]<>PathDelim then Include(HasChars,ccoscWrongPathDelim);
'@','#','$','&','*','(',')','[',']','+','~','<','>','?','|': Include(HasChars,ccoscUnusualChars); '@','#','$','&','*','(',')','[',']','+','~','<','>','?','|': Include(HasChars,ccoscUnusualChars);
#128..#255: Include(HasChars,ccoscNonASCII); #128..#255: Include(HasChars,ccoscNonASCII);
@ -165,7 +164,6 @@ function SpecialCharsToStr(const HasChars: TCCOSpecialChars): string;
begin begin
Result:=''; Result:='';
if ccoscSpaces in HasChars then AddStr(Result,lisCCOSpaces);
if ccoscNonASCII in HasChars then AddStr(Result,lisCCONonASCII); if ccoscNonASCII in HasChars then AddStr(Result,lisCCONonASCII);
if ccoscWrongPathDelim in HasChars then AddStr(Result,lisCCOWrongPathDelimiter); if ccoscWrongPathDelim in HasChars then AddStr(Result,lisCCOWrongPathDelimiter);
if ccoscUnusualChars in HasChars then AddStr(Result,lisCCOUnusualChars); if ccoscUnusualChars in HasChars then AddStr(Result,lisCCOUnusualChars);
@ -219,21 +217,22 @@ var
ErrorMsg: String; ErrorMsg: String;
HasChars: TCCOSpecialChars; HasChars: TCCOSpecialChars;
begin begin
FindSpecialCharsInPath(ExpandedPath,HasChars); FindSpecialCharsInPath(ExpandedPath, HasChars);
Warning:=SpecialCharsToStr(HasChars*[ccoscSpaces,ccoscNonASCII, Warning := SpecialCharsToStr(HasChars * [ccoscNonASCII, ccoscWrongPathDelim, ccoscUnusualChars]);
ccoscWrongPathDelim,ccoscUnusualChars]); ErrorMsg := SpecialCharsToStr(HasChars * [ccoscSpecialChars, ccoscNewLine]);
ErrorMsg:=SpecialCharsToStr(HasChars*[ccoscSpecialChars,ccoscNewLine]);
if Warning<>'' then if Warning <> '' then
AddWarning(Title+' '+Warning); AddWarning(Title + ' ' + Warning);
if ErrorMsg<>'' then begin if ErrorMsg <> '' then
Result:=QuestionDlg(lisCCOInvalidSearchPath,Title+' '+ErrorMsg,mtError, begin
[mrIgnore,lisCCOSkip,mrAbort],0); Result := QuestionDlg(lisCCOInvalidSearchPath, Title + ' ' + ErrorMsg, mtError,
end else begin [mrIgnore, lisCCOSkip, mrAbort], 0);
if Warning='' then end else
Result:=mrOk begin
if Warning = '' then
Result := mrOk
else else
Result:=mrIgnore; Result := mrIgnore;
end; end;
end; end;

View File

@ -1633,7 +1633,6 @@ resourcestring
dlgCCOResults = 'Results'; dlgCCOResults = 'Results';
lisCCOCopyOutputToCliboard = 'Copy output to clipboard'; lisCCOCopyOutputToCliboard = 'Copy output to clipboard';
lisCCOContains = 'contains '; lisCCOContains = 'contains ';
lisCCOSpaces = 'spaces';
lisCCOSpecialCharacters = 'special characters'; lisCCOSpecialCharacters = 'special characters';
lisCCONonASCII = 'non ASCII'; lisCCONonASCII = 'non ASCII';
lisCCOWrongPathDelimiter = 'wrong path delimiter'; lisCCOWrongPathDelimiter = 'wrong path delimiter';