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
|
||||
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, StdCtrls,
|
||||
ExtCtrls, Buttons, ActnList, logger_intf {$IFDEF WST_IDE}, LCLVersion {$ENDIF};
|
||||
ExtCtrls, Buttons, ActnList, logger_intf;
|
||||
|
||||
type
|
||||
|
||||
@ -284,9 +284,9 @@ var
|
||||
fileSet : TSourceTypes;
|
||||
destPath : string;
|
||||
{$IFDEF WST_IDE}
|
||||
i, j, c : Integer;
|
||||
i, c : Integer;
|
||||
srcItm : ISourceStream;
|
||||
trueOpenFlags, openFlags : TOpenFlags;
|
||||
openFlags : TOpenFlags;
|
||||
{$ENDIF}
|
||||
begin
|
||||
oldCursor := Screen.Cursor;
|
||||
@ -301,21 +301,15 @@ begin
|
||||
@ShowStatusMessage, genOptions);
|
||||
ShowStatusMessage(mtInfo,'');
|
||||
{$IFDEF WST_IDE}
|
||||
{$IF lcl_fullversion >= 1030000}
|
||||
openFlags := [ofRevert];
|
||||
if edtAddToProject.Checked then begin
|
||||
openFlags := []; // Could be [ofRevert] but works just fine without it.
|
||||
if edtAddToProject.Checked then
|
||||
Include(openFlags, ofAddToProject);
|
||||
end;
|
||||
c := srcMgnr.GetCount();
|
||||
for i := 0 to Pred(c) do begin
|
||||
srcItm := srcMgnr.GetItem(i);
|
||||
trueOpenFlags := openFlags;
|
||||
if Assigned( LazarusIDE.ActiveProject.FindFile(srcItm.GetFileName(), [pfsfOnlyProjectFiles]) ) then
|
||||
Exclude(trueOpenFlags, ofAddToProject);
|
||||
LazarusIDE.DoOpenEditorFile(destPath + srcItm.GetFileName(), -1, -1, trueOpenFlags);
|
||||
LazarusIDE.DoOpenEditorFile(destPath + srcItm.GetFileName(), -1, -1, OpenFlags);
|
||||
end;
|
||||
{$ENDIF}
|
||||
{$ENDIF}
|
||||
finally
|
||||
srcMgnr := nil;
|
||||
tree.Free();
|
||||
|
@ -16,7 +16,7 @@ unit source_utils;
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils;
|
||||
Classes, SysUtils {$IFDEF WST_IDE}, LazFileUtils {$ENDIF};
|
||||
|
||||
Type
|
||||
|
||||
@ -225,8 +225,14 @@ begin
|
||||
end;
|
||||
|
||||
procedure TSourceStream.SaveToFile(const APath: string);
|
||||
var
|
||||
s: string;
|
||||
begin
|
||||
FStream.SaveToFile(IncludeTrailingPathDelimiter(APath) + GetFileName());
|
||||
s := IncludeTrailingPathDelimiter(APath) + GetFileName();
|
||||
FStream.SaveToFile(s);
|
||||
{$IFDEF WST_IDE}
|
||||
LazFileUtils.InvalidateFileStateCache(s);
|
||||
{$ENDIF}
|
||||
end;
|
||||
|
||||
procedure TSourceStream.Indent();
|
||||
|
Reference in New Issue
Block a user