Packager: Improve a message, make sure a variable is initialized, remove obsolete code

git-svn-id: trunk@32631 -
This commit is contained in:
juha 2011-10-02 22:02:11 +00:00
parent a924d60190
commit 48cbedc75e
2 changed files with 4 additions and 5 deletions

View File

@ -3844,12 +3844,12 @@ resourcestring
+'exists in this package.';
lisA2PTheUnitnameAlreadyExistsInThePackage = 'The unitname %s%s%s already '
+'exists in the package:%s%s';
lisA2PFileAlreadyExistsInThePackage = 'File %s%s%s already exists in the package.';
lisA2PAmbiguousUnitName = 'Ambiguous Unit Name';
lisA2PTheUnitNameIsTheSameAsAnRegisteredComponent = 'The unit name %s%s%s '
+'is the same as an registered component.%sUsing this can cause strange '
+'error messages.';
lisA2PFileAlreadyExistsInThePackage = 'File %s%s%s already exists in the package.';
lisA2PExistingFile = '%sExisting file: %s%s%s';
lisA2PExistingFile2 = 'Existing file: %s%s%s';
lisA2PFileAlreadyExists = 'File already exists';
lisA2PFileIsUsed = 'File is used';
lisA2PTheFileIsPartOfTheCurrentProjectItIsABadIdea = 'The file %s%s%s is '

View File

@ -247,6 +247,7 @@ var
IDEFileFlags: TIDEFileStateFlags;
begin
Result:=false;
PkgFile:=Nil;
// check if package is readonly
if LazPackage.ReadOnly then begin
@ -289,7 +290,7 @@ begin
if PkgFile<>nil then begin
Msg:=Format(lisA2PFileAlreadyExistsInThePackage, ['"',AFilename,'"']);
if PkgFile.Filename<>AFilename then
Msg:=Format(lisA2PExistingFile, [#13, '"', PkgFile.Filename, '"']);
Msg:=Msg+LineEnding+Format(lisA2PExistingFile2, ['"',PkgFile.Filename,'"']);
MessageDlg(lisA2PFileAlreadyExists, Msg, mtError, [mbCancel], 0);
exit;
end;
@ -357,8 +358,6 @@ begin
then
exit;
end;
end else begin
AnUnitName:='';
end;
// ok