mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-11 09:40:31 +01:00
IDE: auto renaming project title when renaming project, bug #10902
git-svn-id: trunk@14339 -
This commit is contained in:
parent
8f3ae0f07f
commit
22bd534fe8
@ -6039,6 +6039,7 @@ var
|
|||||||
Ext: string;
|
Ext: string;
|
||||||
NewBuf: TCodeBuffer;
|
NewBuf: TCodeBuffer;
|
||||||
OldProjectPath: string;
|
OldProjectPath: string;
|
||||||
|
TitleWasDefault: Boolean;
|
||||||
begin
|
begin
|
||||||
OldProjectPath:=Project1.ProjectDirectory;
|
OldProjectPath:=Project1.ProjectDirectory;
|
||||||
|
|
||||||
@ -6167,6 +6168,8 @@ begin
|
|||||||
if Result=mrCancel then exit;
|
if Result=mrCancel then exit;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
TitleWasDefault:=Project1.TitleIsDefault(true);
|
||||||
|
|
||||||
// set new project filename
|
// set new project filename
|
||||||
Project1.ProjectInfoFile:=NewFilename;
|
Project1.ProjectInfoFile:=NewFilename;
|
||||||
@ -6222,6 +6225,12 @@ begin
|
|||||||
Project1.CompilerOptions.DebugPath:=
|
Project1.CompilerOptions.DebugPath:=
|
||||||
RebaseSearchPath(Project1.CompilerOptions.DebugPath,OldProjectPath,
|
RebaseSearchPath(Project1.CompilerOptions.DebugPath,OldProjectPath,
|
||||||
Project1.ProjectDirectory,true);
|
Project1.ProjectDirectory,true);
|
||||||
|
|
||||||
|
// change title
|
||||||
|
if TitleWasDefault then begin
|
||||||
|
Project1.Title:=Project1.GetDefaultTitle;
|
||||||
|
// title does not need to be removed from source, because it was default
|
||||||
|
end;
|
||||||
|
|
||||||
// invalidate cached substituted macros
|
// invalidate cached substituted macros
|
||||||
IncreaseCompilerParseStamp;
|
IncreaseCompilerParseStamp;
|
||||||
|
|||||||
@ -608,7 +608,7 @@ type
|
|||||||
|
|
||||||
// title
|
// title
|
||||||
function GetDefaultTitle: string;
|
function GetDefaultTitle: string;
|
||||||
function TitleIsDefault: boolean;
|
function TitleIsDefault(Fuzzy: boolean = false): boolean;
|
||||||
function IDAsString: string;
|
function IDAsString: string;
|
||||||
function IDAsWord: string;
|
function IDAsWord: string;
|
||||||
|
|
||||||
@ -1956,9 +1956,10 @@ begin
|
|||||||
Result:=ExtractFilenameOnly(ProjectInfoFile);
|
Result:=ExtractFilenameOnly(ProjectInfoFile);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TProject.TitleIsDefault: boolean;
|
function TProject.TitleIsDefault(Fuzzy: boolean): boolean;
|
||||||
begin
|
begin
|
||||||
Result:=(Title='') or (Title=GetDefaultTitle);
|
Result:=(Title='') or (Title=GetDefaultTitle)
|
||||||
|
or (Fuzzy and (SysUtils.CompareText(Title,GetDefaultTitle)=0));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TProject.IDAsString: string;
|
function TProject.IDAsString: string;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user