mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
UPD: more file error log on macOS
This commit is contained in:
parent
900342d648
commit
f6dcf0fd46
3 changed files with 30 additions and 8 deletions
|
|
@ -11,7 +11,7 @@ uses
|
|||
uDebug, uLog,
|
||||
uFileProperty,
|
||||
MacOSAll, CocoaAll, Cocoa_Extra, CocoaUtils,
|
||||
uDarwinUtil, uDarwinFinderModel;
|
||||
uDarwinUtil;
|
||||
|
||||
type
|
||||
|
||||
|
|
@ -40,10 +40,16 @@ type
|
|||
class function getTempPath: String;
|
||||
class function getTerminalPath: String;
|
||||
class function getSpecifiedFolderPath( folder: NSSearchPathDirectory ): String;
|
||||
public
|
||||
class function dataWithContentsOfFile( const path: NSString; const tag: String ): NSData; overload;
|
||||
class function dataWithContentsOfFile( const path: String; const tag: String ): NSData; overload;
|
||||
end;
|
||||
|
||||
implementation
|
||||
|
||||
uses
|
||||
uDarwinFinderModel;
|
||||
|
||||
const
|
||||
ICON_SPECIAL_FOLDER_EXT_STRING = '.app;.musiclibrary;.imovielibrary;.tvlibrary;.photoslibrary;.theater;.saver;.xcode;.xcodeproj;.xcworkspace;.playground;.scptd;.action;.workflow;.prefpane;.appex;.kext;.xpc;.bundle;.qlgenerator;.mdimporter;.systemextension;.fcpbundle;.fcpxmld;';
|
||||
ICON_SPECIAL_PARENT_FOLDER_STRING = '/;/System;/Applications;/Volumes;/Users;~;~/Music;~/Pictures;~/Movies;';
|
||||
|
|
@ -262,6 +268,22 @@ begin
|
|||
end;
|
||||
end;
|
||||
|
||||
class function TDarwinFileUtil.dataWithContentsOfFile
|
||||
( const path: NSString; const tag: String ): NSData;
|
||||
var
|
||||
error: NSError = nil;
|
||||
begin
|
||||
Result:= NSData.dataWithContentsOfFile_options_error( path, 0, @error );
|
||||
if error <> nil then
|
||||
logDarwinError( tag, error );
|
||||
end;
|
||||
|
||||
class function TDarwinFileUtil.dataWithContentsOfFile(
|
||||
const path: String; const tag: String ): NSData;
|
||||
begin
|
||||
Result:= TDarwinFileUtil.dataWithContentsOfFile( StringToNSString(path), tag );
|
||||
end;
|
||||
|
||||
class function TDarwinFileUtil.getDescription(const path: String): String;
|
||||
var
|
||||
error: NSError = nil;
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ uses
|
|||
sqldb, SQLite3Conn, syncobjs,
|
||||
uLog, uDebug,
|
||||
MacOSAll, CocoaAll, CocoaConst, CocoaUtils, Cocoa_Extra,
|
||||
uDarwinUtil;
|
||||
uDarwinFile, uDarwinUtil;
|
||||
|
||||
type
|
||||
|
||||
|
|
@ -396,7 +396,7 @@ var
|
|||
plistProperties: id;
|
||||
error: NSError = nil;
|
||||
begin
|
||||
plistData:= NSData.dataWithContentsOfFile( path );
|
||||
plistData:= TDarwinFileUtil.dataWithContentsOfFile( path, 'TDarwinFinderModelUtil.searchFilesBySavedSearch.analyseSavedSearch()' );
|
||||
if plistData = nil then
|
||||
raise EInOutError.Create( 'savedSearch File Read Error: ' + path.UTF8String );
|
||||
|
||||
|
|
@ -516,7 +516,7 @@ begin
|
|||
Result:= nil;
|
||||
path:= NSHomeDirectory.stringByAppendingString( NSSTR(FAVORITE_FINDER_TAGS_FILE_PATH) );
|
||||
|
||||
plistData:= NSData.dataWithContentsOfFile( path );
|
||||
plistData:= TDarwinFileUtil.dataWithContentsOfFile( path, 'TDarwinFinderModelUtil.getFavoriteTagNames()' );
|
||||
if plistData = nil then
|
||||
Exit;
|
||||
|
||||
|
|
@ -622,7 +622,7 @@ begin
|
|||
Result:= nil;
|
||||
path:= NSHomeDirectory.stringByAppendingString( NSSTR(FINDER_TAGS_FILE_PATH_11minus) );
|
||||
|
||||
plistData:= NSData.dataWithContentsOfFile( path );
|
||||
plistData:= TDarwinFileUtil.dataWithContentsOfFile( path, 'TDarwinFinderModelUtil.getTagsData_macOS11()' );
|
||||
if plistData = nil then
|
||||
Exit;
|
||||
|
||||
|
|
|
|||
|
|
@ -50,15 +50,15 @@ end;
|
|||
|
||||
class function iCloudDriveUtil.getPlistAppIconNames(const path: String ): NSArray;
|
||||
var
|
||||
plistPath: NSString;
|
||||
plistPath: String;
|
||||
plistData: NSData;
|
||||
plistProperties: id;
|
||||
error: NSError = nil;
|
||||
begin
|
||||
Result:= nil;
|
||||
plistPath:= StrToNSString( uDCUtils.ReplaceTilde(path) );
|
||||
plistPath:= uDCUtils.ReplaceTilde( path );
|
||||
|
||||
plistData:= NSData.dataWithContentsOfFile( plistPath );
|
||||
plistData:= TDarwinFileUtil.dataWithContentsOfFile( plistPath, 'iCloudDriveUtil.getPlistAppIconNames()' );
|
||||
if plistData = nil then
|
||||
Exit;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue