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