You've already forked lazarus-ccr
IDE ImportDlg's option to include files now works (Thanks Juha Maninnen) :
* Flag ofRevert is not needed. File is not added to project if already there. * Invalidate file cache after generating a Pascal file. Prevents error when opening it. Works also with older Lazarus versions. git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3200 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -6,7 +6,7 @@ interface
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, StdCtrls,
|
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, StdCtrls,
|
||||||
ExtCtrls, Buttons, ActnList, logger_intf {$IFDEF WST_IDE}, LCLVersion {$ENDIF};
|
ExtCtrls, Buttons, ActnList, logger_intf;
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
@ -284,9 +284,9 @@ var
|
|||||||
fileSet : TSourceTypes;
|
fileSet : TSourceTypes;
|
||||||
destPath : string;
|
destPath : string;
|
||||||
{$IFDEF WST_IDE}
|
{$IFDEF WST_IDE}
|
||||||
i, j, c : Integer;
|
i, c : Integer;
|
||||||
srcItm : ISourceStream;
|
srcItm : ISourceStream;
|
||||||
trueOpenFlags, openFlags : TOpenFlags;
|
openFlags : TOpenFlags;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
begin
|
begin
|
||||||
oldCursor := Screen.Cursor;
|
oldCursor := Screen.Cursor;
|
||||||
@ -301,21 +301,15 @@ begin
|
|||||||
@ShowStatusMessage, genOptions);
|
@ShowStatusMessage, genOptions);
|
||||||
ShowStatusMessage(mtInfo,'');
|
ShowStatusMessage(mtInfo,'');
|
||||||
{$IFDEF WST_IDE}
|
{$IFDEF WST_IDE}
|
||||||
{$IF lcl_fullversion >= 1030000}
|
openFlags := []; // Could be [ofRevert] but works just fine without it.
|
||||||
openFlags := [ofRevert];
|
if edtAddToProject.Checked then
|
||||||
if edtAddToProject.Checked then begin
|
|
||||||
Include(openFlags, ofAddToProject);
|
Include(openFlags, ofAddToProject);
|
||||||
end;
|
|
||||||
c := srcMgnr.GetCount();
|
c := srcMgnr.GetCount();
|
||||||
for i := 0 to Pred(c) do begin
|
for i := 0 to Pred(c) do begin
|
||||||
srcItm := srcMgnr.GetItem(i);
|
srcItm := srcMgnr.GetItem(i);
|
||||||
trueOpenFlags := openFlags;
|
LazarusIDE.DoOpenEditorFile(destPath + srcItm.GetFileName(), -1, -1, OpenFlags);
|
||||||
if Assigned( LazarusIDE.ActiveProject.FindFile(srcItm.GetFileName(), [pfsfOnlyProjectFiles]) ) then
|
|
||||||
Exclude(trueOpenFlags, ofAddToProject);
|
|
||||||
LazarusIDE.DoOpenEditorFile(destPath + srcItm.GetFileName(), -1, -1, trueOpenFlags);
|
|
||||||
end;
|
end;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
{$ENDIF}
|
|
||||||
finally
|
finally
|
||||||
srcMgnr := nil;
|
srcMgnr := nil;
|
||||||
tree.Free();
|
tree.Free();
|
||||||
|
@ -16,7 +16,7 @@ unit source_utils;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
Classes, SysUtils;
|
Classes, SysUtils {$IFDEF WST_IDE}, LazFileUtils {$ENDIF};
|
||||||
|
|
||||||
Type
|
Type
|
||||||
|
|
||||||
@ -225,8 +225,14 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TSourceStream.SaveToFile(const APath: string);
|
procedure TSourceStream.SaveToFile(const APath: string);
|
||||||
|
var
|
||||||
|
s: string;
|
||||||
begin
|
begin
|
||||||
FStream.SaveToFile(IncludeTrailingPathDelimiter(APath) + GetFileName());
|
s := IncludeTrailingPathDelimiter(APath) + GetFileName();
|
||||||
|
FStream.SaveToFile(s);
|
||||||
|
{$IFDEF WST_IDE}
|
||||||
|
LazFileUtils.InvalidateFileStateCache(s);
|
||||||
|
{$ENDIF}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TSourceStream.Indent();
|
procedure TSourceStream.Indent();
|
||||||
|
Reference in New Issue
Block a user