|
@@ -103,6 +103,11 @@ type
|
|
procedure Execute; override;
|
|
procedure Execute; override;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+ // WORKAROUND: TQueue<Integer>.Create fails when TDirView is created in IDE, while TQueue<TIconUpdateSchedule>.Create works
|
|
|
|
+ TIconUpdateSchedule = record
|
|
|
|
+ Index: Integer;
|
|
|
|
+ end;
|
|
|
|
+
|
|
{ TDirView }
|
|
{ TDirView }
|
|
TDirView = class(TCustomDirView)
|
|
TDirView = class(TCustomDirView)
|
|
private
|
|
private
|
|
@@ -128,8 +133,8 @@ type
|
|
FIconUpdateThread: TIconUpdateThread;
|
|
FIconUpdateThread: TIconUpdateThread;
|
|
// only ever accessed by GUI thread
|
|
// only ever accessed by GUI thread
|
|
FIconUpdateSet: TDictionary<Integer, Boolean>;
|
|
FIconUpdateSet: TDictionary<Integer, Boolean>;
|
|
- FIconUpdateQueue: TQueue<Integer>;
|
|
|
|
- FIconUpdateQueueDeferred: TQueue<Integer>;
|
|
|
|
|
|
+ FIconUpdateQueue: TQueue<TIconUpdateSchedule>;
|
|
|
|
+ FIconUpdateQueueDeferred: TQueue<TIconUpdateSchedule>;
|
|
FDiscMonitor: TDiscMonitor;
|
|
FDiscMonitor: TDiscMonitor;
|
|
FHomeDirectory: string;
|
|
FHomeDirectory: string;
|
|
|
|
|
|
@@ -691,8 +696,8 @@ begin
|
|
end;
|
|
end;
|
|
|
|
|
|
FIconUpdateSet := TDictionary<Integer, Boolean>.Create;
|
|
FIconUpdateSet := TDictionary<Integer, Boolean>.Create;
|
|
- FIconUpdateQueue := TQueue<Integer>.Create;
|
|
|
|
- FIconUpdateQueueDeferred := TQueue<Integer>.Create;
|
|
|
|
|
|
+ FIconUpdateQueue := TQueue<TIconUpdateSchedule>.Create;
|
|
|
|
+ FIconUpdateQueueDeferred := TQueue<TIconUpdateSchedule>.Create;
|
|
|
|
|
|
FLastPath := nil;
|
|
FLastPath := nil;
|
|
end; {Create}
|
|
end; {Create}
|
|
@@ -2294,6 +2299,7 @@ var
|
|
Value: string;
|
|
Value: string;
|
|
ASize: Int64;
|
|
ASize: Int64;
|
|
FetchIcon: Boolean;
|
|
FetchIcon: Boolean;
|
|
|
|
+ Schedule: TIconUpdateSchedule;
|
|
begin
|
|
begin
|
|
Assert(Assigned(ListItem) and Assigned(ListItem.Data));
|
|
Assert(Assigned(ListItem) and Assigned(ListItem.Data));
|
|
with PFileRec(ListItem.Data)^, DispInfo do
|
|
with PFileRec(ListItem.Data)^, DispInfo do
|
|
@@ -2318,7 +2324,8 @@ begin
|
|
(not FIconUpdateSet.ContainsKey(ListItem.Index)) then
|
|
(not FIconUpdateSet.ContainsKey(ListItem.Index)) then
|
|
begin
|
|
begin
|
|
FIconUpdateSet.Add(ListItem.Index, False);
|
|
FIconUpdateSet.Add(ListItem.Index, False);
|
|
- FIconUpdateQueue.Enqueue(ListItem.Index);
|
|
|
|
|
|
+ Schedule.Index := ListItem.Index;
|
|
|
|
+ FIconUpdateQueue.Enqueue(Schedule);
|
|
StartIconUpdateThread;
|
|
StartIconUpdateThread;
|
|
end;
|
|
end;
|
|
|
|
|
|
@@ -2390,9 +2397,9 @@ end;
|
|
function TDirView.IconUpdatePeek: Integer;
|
|
function TDirView.IconUpdatePeek: Integer;
|
|
begin
|
|
begin
|
|
if FIconUpdateQueue.Count > 0 then
|
|
if FIconUpdateQueue.Count > 0 then
|
|
- Result := FIconUpdateQueue.Peek
|
|
|
|
|
|
+ Result := FIconUpdateQueue.Peek.Index
|
|
else if FIconUpdateQueueDeferred.Count > 0 then
|
|
else if FIconUpdateQueueDeferred.Count > 0 then
|
|
- Result := FIconUpdateQueueDeferred.Peek
|
|
|
|
|
|
+ Result := FIconUpdateQueueDeferred.Peek.Index
|
|
else
|
|
else
|
|
Result := -1;
|
|
Result := -1;
|
|
end;
|
|
end;
|