mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-18 02:19:32 +02:00
ide: drop files: invalidate file cache
This commit is contained in:
parent
20d97cb590
commit
d26619895d
@ -5890,6 +5890,11 @@ var
|
|||||||
begin
|
begin
|
||||||
//DebugLn(['TMainIDE.DoDropFiles: ',length(Filenames), ' files, WindowIndex=', WindowIndex]);
|
//DebugLn(['TMainIDE.DoDropFiles: ',length(Filenames), ' files, WindowIndex=', WindowIndex]);
|
||||||
if Length(FileNames) = 0 then exit;
|
if Length(FileNames) = 0 then exit;
|
||||||
|
|
||||||
|
// the Drop event comes before the Application activate event or not at all
|
||||||
|
// => invalidate file state
|
||||||
|
InvalidateFileStateCache;
|
||||||
|
|
||||||
FileList := TStringList.Create;
|
FileList := TStringList.Create;
|
||||||
FileList.AddStrings(FileNames);
|
FileList.AddStrings(FileNames);
|
||||||
try
|
try
|
||||||
|
@ -414,7 +414,7 @@ implementation
|
|||||||
procedure TMainIDEBar.MainIDEBarDropFiles(Sender: TObject;
|
procedure TMainIDEBar.MainIDEBarDropFiles(Sender: TObject;
|
||||||
const FileNames: array of String);
|
const FileNames: array of String);
|
||||||
begin
|
begin
|
||||||
// the Drop event comes before the Application activate event
|
// the Drop event comes before the Application activate event or not at all
|
||||||
// => invalidate file state
|
// => invalidate file state
|
||||||
InvalidateFileStateCache;
|
InvalidateFileStateCache;
|
||||||
LazarusIDE.DoDropFiles(Sender,FileNames);
|
LazarusIDE.DoDropFiles(Sender,FileNames);
|
||||||
|
@ -895,6 +895,11 @@ begin
|
|||||||
debugln(['TProjectInspectorForm.FormDropFiles ',length(FileNames)]);
|
debugln(['TProjectInspectorForm.FormDropFiles ',length(FileNames)]);
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
if length(FileNames)=0 then exit;
|
if length(FileNames)=0 then exit;
|
||||||
|
|
||||||
|
// the Drop event comes before the Application activate event or not at all
|
||||||
|
// => invalidate file state
|
||||||
|
InvalidateFileStateCache;
|
||||||
|
|
||||||
BeginUpdate;
|
BeginUpdate;
|
||||||
try
|
try
|
||||||
for i:=0 to high(Filenames) do
|
for i:=0 to high(Filenames) do
|
||||||
|
@ -392,6 +392,10 @@ var
|
|||||||
begin
|
begin
|
||||||
if length(FileNames) = 1 then // only one file
|
if length(FileNames) = 1 then // only one file
|
||||||
begin
|
begin
|
||||||
|
// the Drop event comes before the Application activate event or not at all
|
||||||
|
// => invalidate file state
|
||||||
|
InvalidateFileStateCache;
|
||||||
|
|
||||||
lFilename := CleanAndExpandFilename(FileNames[0]);
|
lFilename := CleanAndExpandFilename(FileNames[0]);
|
||||||
LoadPackageListFromFile(lFilename);
|
LoadPackageListFromFile(lFilename);
|
||||||
end;
|
end;
|
||||||
|
@ -1505,7 +1505,6 @@ end;
|
|||||||
procedure TPackageEditorForm.FormDropFiles(Sender: TObject;
|
procedure TPackageEditorForm.FormDropFiles(Sender: TObject;
|
||||||
const FileNames: array of String);
|
const FileNames: array of String);
|
||||||
var
|
var
|
||||||
i: Integer;
|
|
||||||
Files: TStringList;
|
Files: TStringList;
|
||||||
begin
|
begin
|
||||||
{$IFDEF VerbosePkgEditDrag}
|
{$IFDEF VerbosePkgEditDrag}
|
||||||
@ -1514,13 +1513,13 @@ begin
|
|||||||
if length(FileNames)=0 then exit;
|
if length(FileNames)=0 then exit;
|
||||||
|
|
||||||
//debugln(['TPackageEditorForm.FormDropFiles ']);
|
//debugln(['TPackageEditorForm.FormDropFiles ']);
|
||||||
// the Drop does not always trigger an application activate event -> invalidate here
|
// the Drop event comes before the Application activate event or not at all
|
||||||
|
// => invalidate file state
|
||||||
InvalidateFileStateCache;
|
InvalidateFileStateCache;
|
||||||
|
|
||||||
Files:=TStringList.Create;
|
Files:=TStringList.Create;
|
||||||
try
|
try
|
||||||
for i:=0 to high(Filenames) do
|
Files.AddStrings(FileNames);
|
||||||
Files.Add(FileNames[i]);
|
|
||||||
AddUserFiles(Files);
|
AddUserFiles(Files);
|
||||||
finally
|
finally
|
||||||
Files.Free;
|
Files.Free;
|
||||||
|
Loading…
Reference in New Issue
Block a user