mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
ADD: support loading iCloud Drive on restart
This commit is contained in:
parent
5c44a8c628
commit
c9c61eeba3
3 changed files with 27 additions and 13 deletions
|
|
@ -607,7 +607,7 @@ implementation
|
|||
uses
|
||||
Clipbrd, Dialogs, LCLProc, LCLType, Forms, dmCommonData,
|
||||
uShellExecute, fMaskInputDlg, uMasks, DCOSUtils, uOSUtils, DCStrUtils,
|
||||
uDCUtils, uDebug, uLng, uShowMsg, uFileSystemFileSource, uFileSourceUtil,
|
||||
uDCUtils, uDebug, uLng, uShowMsg, uFileSystemFileSource, uiCloudDriver, uFileSourceUtil,
|
||||
uFileViewNotebook, uSearchTemplate, uKeyboard, uFileFunctions,
|
||||
fMain, uSearchResultFileSource, uFileSourceProperty, uVfsModule, uFileViewWithPanels;
|
||||
|
||||
|
|
@ -2617,6 +2617,8 @@ begin
|
|||
// allow it to read its configuration from FSNode.
|
||||
if sFSType = 'FileSystem' then
|
||||
aFileSource := TFileSystemFileSource.GetFileSource
|
||||
else if sFSType = 'TiCloudDriverFileSource' then
|
||||
aFileSource := TiCloudDriverFileSource.GetFileSource
|
||||
else begin
|
||||
FileSourceClass := gVfsModuleList.FindFileSource(sFSType);
|
||||
if Assigned(FileSourceClass) then aFileSource := FileSourceClass.Create;
|
||||
|
|
|
|||
|
|
@ -86,17 +86,7 @@ begin
|
|||
Notebook := frmMain.ActiveNotebook;
|
||||
NewPage := Notebook.NewPage(Notebook.ActiveView);
|
||||
|
||||
iCloudFS := TiCloudDriverFileSource.Create;
|
||||
iCloudFS.mountAppPoint( 'com~apple~Pages' );
|
||||
iCloudFS.mountAppPoint( 'com~apple~Numbers' );
|
||||
iCloudFS.mountAppPoint( 'com~apple~Keynote' );
|
||||
iCloudFS.mountAppPoint( 'com~apple~ScriptEditor2' );
|
||||
iCloudFS.mountAppPoint( 'iCloud~is~workflow~my~workflows' );
|
||||
iCloudFS.mountAppPoint( 'iCloud~com~apple~Playgrounds' );
|
||||
iCloudFS.mountAppPoint( 'iCloud~com~toketaware~ios~ithoughts' );
|
||||
iCloudFS.mountAppPoint( 'iCloud~net~xmind~brownieapp' );
|
||||
iCloudFS.mount( '~/Library/Mobile Documents/com~apple~CloudDocs', '/' );
|
||||
|
||||
iCloudFS := TiCloudDriverFileSource.GetFileSource;
|
||||
NewPage.FileView.AddFileSource(iCloudFS, iCloudFS.GetRootDir);
|
||||
NewPage.MakeActive;
|
||||
end;
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ interface
|
|||
|
||||
uses
|
||||
Classes, SysUtils, Menus,
|
||||
uFile, uDisplayFile, uFileSource, uMountedFileSource,
|
||||
uFile, uDisplayFile, uFileSource, uMountedFileSource, uFileSourceManager,
|
||||
uDCUtils, uMyDarwin,
|
||||
CocoaAll, CocoaUtils, Cocoa_Extra;
|
||||
|
||||
|
|
@ -33,6 +33,7 @@ type
|
|||
procedure download( const files: TFiles );
|
||||
function getDefaultPointForPath( const path: String ): String; override;
|
||||
public
|
||||
class function GetFileSource: TiCloudDriverFileSource;
|
||||
function GetUIHandler: TFileSourceUIHandler; override;
|
||||
|
||||
function GetRootDir(sPath : String): String; override;
|
||||
|
|
@ -162,7 +163,17 @@ end;
|
|||
constructor TiCloudDriverFileSource.Create;
|
||||
begin
|
||||
inherited Create;
|
||||
|
||||
_appIcons:= NSMutableDictionary.new;
|
||||
self.mountAppPoint( 'com~apple~Pages' );
|
||||
self.mountAppPoint( 'com~apple~Numbers' );
|
||||
self.mountAppPoint( 'com~apple~Keynote' );
|
||||
self.mountAppPoint( 'com~apple~ScriptEditor2' );
|
||||
self.mountAppPoint( 'iCloud~is~workflow~my~workflows' );
|
||||
self.mountAppPoint( 'iCloud~com~apple~Playgrounds' );
|
||||
self.mountAppPoint( 'iCloud~com~toketaware~ios~ithoughts' );
|
||||
self.mountAppPoint( 'iCloud~net~xmind~brownieapp' );
|
||||
self.mount( '~/Library/Mobile Documents/com~apple~CloudDocs', '/' );
|
||||
end;
|
||||
|
||||
destructor TiCloudDriverFileSource.Destroy;
|
||||
|
|
@ -313,6 +324,17 @@ begin
|
|||
Result:= getMacOSDisplayNameFromPath( path );
|
||||
end;
|
||||
|
||||
class function TiCloudDriverFileSource.GetFileSource: TiCloudDriverFileSource;
|
||||
var
|
||||
aFileSource: IFileSource;
|
||||
begin
|
||||
aFileSource := FileSourceManager.Find(TiCloudDriverFileSource, '');
|
||||
if not Assigned(aFileSource) then
|
||||
Result := TiCloudDriverFileSource.Create
|
||||
else
|
||||
Result := aFileSource as TiCloudDriverFileSource;
|
||||
end;
|
||||
|
||||
function TiCloudDriverFileSource.GetRootDir(sPath: String): String;
|
||||
var
|
||||
path: String;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue