From 0da8d34560829ccd61755eefa09bf99d1c0711bb Mon Sep 17 00:00:00 2001 From: mattias Date: Sun, 8 Jun 2003 11:05:45 +0000 Subject: [PATCH] implemented filename case check before adding to project git-svn-id: trunk@4243 - --- ide/lazarusidestrconsts.pas | 6 ++++++ ide/project.pp | 13 ++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/ide/lazarusidestrconsts.pas b/ide/lazarusidestrconsts.pas index 5bbdf3d356..527c92f9a3 100644 --- a/ide/lazarusidestrconsts.pas +++ b/ide/lazarusidestrconsts.pas @@ -257,6 +257,7 @@ resourcestring lisThereAreOtherFilesInTheDirectoryWithTheSameName = 'There are other files ' +'in the directory with the same name,%swhich only differ in case:%s%s%' +'sDelete them?'; + lisDeleteOldFile = 'Delete old file %s%s%s?'; lisDeletingOfFileFailed = 'Deleting of file %s%s%s failed.'; lisStreamingError = 'Streaming error'; lisUnableToStreamT = 'Unable to stream %s:T%s.'; @@ -371,6 +372,11 @@ resourcestring lisUnableToRenameFileTo = 'Unable to rename file %s%s%s to %s%s%s!'; lisBackupFileFailed = 'Backup file failed'; lisUnableToBackupFileTo = 'Unable to backup file %s%s%s to %s%s%s!'; + lisFileNotLowercase = 'File not lowercase'; + lisTheUnitIsNotLowercaseTheFreePascalCompiler10XNeeds = 'The unit %s%s%s is ' + +'not lowercase.%sThe FreePascal compiler 1.0.x needs lowercase ' + +'filenames. If you do not use the fpc 1.0.x to compile this unit, you ' + +'can ignore this message.%s%sRename file?'; lisDeleteAmbigiousFile = 'Delete ambigious file?'; lisAmbigiousFileFoundThisFileCanBeMistakenWithDelete = 'Ambigious file ' +'found: %s%s%s%sThis file can be mistaken with %s%s%s%s%sDelete the ' diff --git a/ide/project.pp b/ide/project.pp index 651c3551f8..c3574c1780 100644 --- a/ide/project.pp +++ b/ide/project.pp @@ -150,12 +150,13 @@ type function WriteUnitSourceToFile(const AFileName: string): TModalResult; procedure Clear; procedure CreateStartCode(NewUnitType: TNewUnitType; - const NewUnitName: string); + const NewUnitName: string); procedure DecreaseAutoRevertLock; procedure IgnoreCurrentFileDateOnDisk; procedure IncreaseAutoRevertLock; procedure LoadFromXMLConfig(XMLConfig: TXMLConfig; const Path: string); procedure ReadUnitNameFromSource; + function CreateUnitName: string; procedure SaveToXMLConfig(XMLConfig: TXMLConfig; const Path: string); procedure UpdateUsageCount(Min, IfBelowThis, IncIfBelow: extended); procedure UpdateUsageCount(TheUsage: TUnitUsage; Factor: extended); @@ -666,6 +667,13 @@ begin fUnitName:=CodeToolBoss.GetSourceName(fSource,false); end; +function TUnitInfo.CreateUnitName: string; +begin + Result:=UnitName; + if (Result='') and FilenameIsPascalUnit(Filename) then + Result:=ExtractFilenameOnly(Filename); +end; + {------------------------------------------------------------------------------ TUnitInfo Clear ------------------------------------------------------------------------------} @@ -2639,6 +2647,9 @@ end. { $Log$ + Revision 1.128 2003/06/08 11:05:45 mattias + implemented filename case check before adding to project + Revision 1.127 2003/06/03 16:12:14 mattias fixed loading bookmarks for editor index 0