Skip to content

Commit 1eee530

Browse files
FIX: rootfolder was not always with including pathdelim -> leads to open file issues
1 parent f6ceef7 commit 1eee530

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

src/ufpc_understand.pas

+8-2
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666

6767
TFiles = Record
6868
LPISource: String;
69-
RootFolder: String;
69+
RootFolder: String; // Endet immer auf Pathdelim
7070
Files: TFileList;
7171
End;
7272

@@ -1065,6 +1065,7 @@
10651065

10661066
Procedure TProject.SetRootFolder(AValue: String);
10671067
Begin
1068+
AValue := IncludeTrailingPathDelimiter(AValue);
10681069
If AValue <> fFiles.RootFolder Then Begin
10691070
fChanged := true;
10701071
fFiles.RootFolder := AValue;
@@ -1105,6 +1106,9 @@
11051106
// Retry with "old" Style..
11061107
fFiles.RootFolder := ini.ReadString('Files', 'RootFolder', '');
11071108
End;
1109+
If fFiles.RootFolder <> '' Then Begin
1110+
fFiles.RootFolder := IncludeTrailingPathDelimiter(fFiles.RootFolder);
1111+
End;
11081112
fFiles.LPISource := ini.ReadString('Files', 'LPISource', '');
11091113
cnt := ini.readInteger('Files', 'Count', 0);
11101114

@@ -1116,8 +1120,10 @@
11161120
If (fFiles.RootFolder = '') Or ((fFiles.RootFolder <> '') And Not DirectoryExistsUTF8(fFiles.RootFolder)) Then Begin
11171121
ShowMessage('Your project root folder seems to be invalid (old value was: "' + fFiles.RootFolder + '"), please select a correct one for: ' + fGeneral.ProjectName);
11181122
fFiles.RootFolder := '';
1119-
If SelectDirectory('Root folder for: ' + fGeneral.ProjectName, '', fFiles.RootFolder) Then
1123+
If SelectDirectory('Root folder for: ' + fGeneral.ProjectName, '', fFiles.RootFolder) Then Begin
1124+
fFiles.RootFolder := IncludeTrailingPathDelimiter(fFiles.RootFolder);
11201125
fChanged := true;
1126+
End;
11211127
End;
11221128
End;
11231129

src/unit1.pas

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
(******************************************************************************)
22
(* FPC Understand 30.03.2023 *)
33
(* *)
4-
(* Version : 0.27 *)
4+
(* Version : 0.28 *)
55
(* *)
66
(* Author : Uwe Schächterle (Corpsman) *)
77
(* *)
@@ -66,6 +66,7 @@
6666
(* 0.26 - FIX: Line index after {$I ...} *)
6767
(* 0.27 - ADD: Support recursive {$I ...} *)
6868
(* FIX: Set carety when showing code editor *)
69+
(* 0.28 - FIX: invalid Rootfolder *)
6970
(* *)
7071
(* Known Bugs : - if a project holds 2 units with the same name *)
7172
(* the dependency graph will merge them to one *)
@@ -94,7 +95,7 @@
9495
StdCtrls, ugraphs, ufpc_understand, ufpcparser, LvlGraphCtrl, Types;
9596

9697
Const
97-
Version = '0.25';
98+
Version = '0.28';
9899
ScrollDelta = 25;
99100

100101
Type
@@ -1315,7 +1316,7 @@
13151316
FPCParser := TFPCParser.Create;
13161317
For i := 0 To high(FileList) Do Begin
13171318
If FileList[i].Enabled Then Begin
1318-
f.Filename := ExtractRelativePath(fProject.RootFolder, FileList[i].FileName);
1319+
f.Filename := ExtractRelativePath(IncludeTrailingPathDelimiter(fProject.RootFolder), FileList[i].FileName);
13191320
If FPCParser.ParseFile(FileList[i].FileName, SearchPaths) Then Begin
13201321
f.FileInfo := FPCParser.FileInfo;
13211322
f.Methods := FPCParser.ProcInfos;

src/unit2.pas

+1-1
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@
496496
aProject.ChartStatisticSettings.BoarderForAverageMostComplexFiles := strtointdef(edit8.Text, Default_BoarderForAverageMostComplexFiles);
497497

498498
// Files
499-
aProject.RootFolder := IncludeTrailingPathDelimiter(label6.Caption);
499+
aProject.RootFolder := label6.Caption;
500500
aProject.LPISource := label2.Caption;
501501
For i := 0 To high(fList) Do Begin
502502
fList[i].Enabled := CheckListBox1.Checked[i];

0 commit comments

Comments
 (0)