Просмотр исходного кода

Code formatting

Source commit: 0a0479c659353bc5feeef821548093d1aba8fac2
Martin Prikryl 1 год назад
Родитель
Сommit
e3f29652ac
1 измененных файлов с 10 добавлено и 7 удалено
  1. 10 7
      source/packages/filemng/DirView.pas

+ 10 - 7
source/packages/filemng/DirView.pas

@@ -682,7 +682,7 @@ begin
         FOwner.DoFetchIcon(FCurrentFilePath, IsSpecialExt, False, @FCurrentItemData, FSyncIcon, TypeName);
       except
         {Capture exceptions generated by the shell}
-        FSyncIcon := UnKnownFileIcon;
+        FSyncIcon := UnknownFileIcon;
       end;
       if Terminated then
       begin
@@ -1868,7 +1868,7 @@ begin
         if IconEmpty then
         begin
           if FileExt = ExeExtension then ImageIndex := DefaultExeIcon
-            else ImageIndex  := UnknownFileIcon;
+            else ImageIndex := UnknownFileIcon;
         end;
       end;
       Empty := False;
@@ -2379,15 +2379,19 @@ procedure TDirView.GetDisplayInfo(ListItem: TListItem;
 var
   Value: string;
   ASize: Int64;
+  FetchIcon: Boolean;
 begin
   Assert(Assigned(ListItem) and Assigned(ListItem.Data));
   with PFileRec(ListItem.Data)^, DispInfo  do
   begin
     {Fetch display data of current file:}
     if Empty then
-      GetDisplayData(ListItem, IconEmpty and
-        (not FUseIconUpdateThread or
-         (ViewStyle <> vsReport)));
+    begin
+      FetchIcon :=
+        IconEmpty and
+        (not FUseIconUpdateThread or (ViewStyle <> vsReport));
+      GetDisplayData(ListItem, FetchIcon);
+    end;
 
     if IconEmpty and
        (not FUseIconUpdateThread or
@@ -2507,8 +2511,7 @@ begin
       // This prevents Destroy from waiting for (stalled) thread
       FIconUpdateThread.Suspend;
     end;
-    FIconUpdateThread.Destroy;
-    FIconUpdateThread := nil;
+    FreeAndNil(FIconUpdateThread);
   end;
 end; {StopIconUpdateThread}