mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
UPD: split image cache for Ext and Fullpath as NameSpace on macOS
This commit is contained in:
parent
8d784194e6
commit
37e7749fe8
4 changed files with 11 additions and 8 deletions
|
|
@ -97,7 +97,7 @@ begin
|
|||
|
||||
{$IFDEF DARWIN}
|
||||
if path = PathDelim then
|
||||
Result:= darwinImageCacheManager.copyIconForFileExt( FCurrentAddress, iconSize );
|
||||
Result:= darwinImageCacheForExt.copyIconForFileExt( FCurrentAddress, iconSize );
|
||||
{$ENDIF}
|
||||
end;
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ uses
|
|||
uiCloudDrive, uSearchResultFileSource, uFileSystemFileSource, uFileSource,
|
||||
uFile, uDisplayFile, uFileProperty,
|
||||
uFileView, uFileViewNotebook,
|
||||
uDarwinFinderModel, uDarwinFinder, uDarwinImage, uDarwinFile, uDarwinUtil,
|
||||
uDarwinFinderModel, uDarwinFinder, uDarwinImage, uDarwinFile,
|
||||
ulng, uGlobs,
|
||||
MacOSAll, CocoaAll;
|
||||
|
||||
|
|
@ -152,7 +152,7 @@ function TSmartFolderSearchResultFileSource.GetCustomIcon(
|
|||
const path: String;
|
||||
const iconSize: Integer ): TBitmap;
|
||||
begin
|
||||
Result:= darwinImageCacheManager.copyIconForFileExt( 'savedSearch', iconSize );
|
||||
Result:= darwinImageCacheForExt.copyIconForFileExt( 'savedSearch', iconSize );
|
||||
end;
|
||||
|
||||
{ TDarwinSearchResultHandler }
|
||||
|
|
|
|||
|
|
@ -64,7 +64,8 @@ type
|
|||
end;
|
||||
|
||||
var
|
||||
darwinImageCacheManager: TDarwinImageCacheManager;
|
||||
darwinImageCacheForPath: TDarwinImageCacheManager;
|
||||
darwinImageCacheForExt: TDarwinImageCacheManager;
|
||||
|
||||
implementation
|
||||
|
||||
|
|
@ -290,10 +291,12 @@ begin
|
|||
end;
|
||||
|
||||
initialization
|
||||
darwinImageCacheManager:= TDarwinImageCacheManager.Create;
|
||||
darwinImageCacheForPath:= TDarwinImageCacheManager.Create;
|
||||
darwinImageCacheForExt:= TDarwinImageCacheManager.Create;
|
||||
|
||||
finalization
|
||||
FreeAndNil( darwinImageCacheManager );
|
||||
FreeAndNil( darwinImageCacheForPath );
|
||||
FreeAndNil( darwinImageCacheForExt );
|
||||
|
||||
end.
|
||||
|
||||
|
|
|
|||
|
|
@ -719,12 +719,12 @@ begin
|
|||
Result:= nil;
|
||||
if path = GetRootDir(path) then begin
|
||||
TiCloudDriveFileSource.GetMainIcon( iconPath );
|
||||
Result:= darwinImageCacheManager.copyImageForFileContent( iconPath, iconSize );
|
||||
Result:= darwinImageCacheForPath.copyImageForFileContent( iconPath, iconSize );
|
||||
end else begin
|
||||
realPath:= self.GetRealPath( path );
|
||||
image:= getAppIconByPath( realPath );
|
||||
if image <> nil then
|
||||
Result:= darwinImageCacheManager.copyImageForNSImage( realPath, image );
|
||||
Result:= darwinImageCacheForPath.copyImageForNSImage( realPath, image );
|
||||
end;
|
||||
end;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue