Browse Source

Unused code

(cherry picked from commit d1c2ab1371ddeb9c341e9b9a30665fa530faf714)

Source commit: 5c8fe15418928a48f778889afff451c232deba5b
Martin Prikryl 5 years ago
parent
commit
2433a71287
2 changed files with 0 additions and 158 deletions
  1. 0 49
      source/packages/filemng/DirView.pas
  2. 0 109
      source/packages/filemng/DriveView.pas

+ 0 - 49
source/packages/filemng/DirView.pas

@@ -284,8 +284,6 @@ type
     {Other additional functions: }
     procedure ClearIconCache;
 
-    {Create a new file:}
-    function CreateFile(NewName: string): TListItem; dynamic;
     {Create a new subdirectory:}
     procedure CreateDirectory(DirName: string); override;
     {Delete all selected files:}
@@ -408,7 +406,6 @@ procedure CheckCanOpenDirectory(Path: string);
 
 var
   LastClipBoardOperation: TClipBoardOperation;
-  LastIOResult: DWORD;
 
 implementation
 
@@ -2208,51 +2205,6 @@ begin
   end;
 end; {ValidateSelectedFiles}
 
-function TDirView.CreateFile(NewName: string): TListItem;
-var
-  F: file;
-  SRec: SysUtils.TSearchRec;
-begin
-  Result := nil;
-  {Neue Datei anlegen:}
-  NewName := Path + '\' + NewName;
-
-  {Ermitteln des neuen Dateinamens:}
-  if not FileExists(ApiPath(NewName)) then
-  begin
-    if FWatchForChanges then
-      StopWatchThread;
-    StopIconUpdateThread;
-
-    try
-      {Create the desired file as empty file:}
-      AssignFile(F, ApiPath(NewName));
-      Rewrite(F);
-      LastIOResult := IOResult;
-      if LastIOResult = 0 then
-      begin
-        CloseFile(F);
-
-        {Anlegen der Datei als TListItem:}
-        if FindFirst(ApiPath(NewName), faAnyFile, SRec) = 0 then
-        begin
-          Result := AddItem(SRec);
-          ItemFocused := FindFileItem(GetFileRec(Result.Index)^.FileName);
-          if Assigned(ItemFocused) then
-            ItemFocused.MakeVisible(False);
-        end;
-        FindClose(Srec);
-      end;
-    finally
-      if FUseIconUpdateThread then
-        StartIconUpdateThread;
-      if WatchForChanges then
-        StartWatchThread;
-    end;
-  end
-    else LastIOResult := 183;
-end; {CreateFile}
-
 procedure TDirView.CreateDirectory(DirName: string);
 var
   SRec: SysUtils.TSearchRec;
@@ -3473,6 +3425,5 @@ end;
 
 initialization
   LastClipBoardOperation := cboNone;
-  LastIOResult := 0;
   DaylightHack := (not IsWin7);
 end.

+ 0 - 109
source/packages/filemng/DriveView.pas

@@ -254,10 +254,6 @@ type
 
     function GetFQPIDL(Node: TTreeNode): PItemIDList;
 
-    {Directory update:}
-    function  CreateDirectory(ParentNode: TTreeNode; NewName: string): TTreeNode; dynamic;
-    function  DeleteDirectory(Node: TTreeNode; AllowUndo: Boolean): Boolean; dynamic;
-
     constructor Create(AOwner: TComponent); override;
     destructor Destroy; override;
 
@@ -1970,111 +1966,6 @@ begin
   Result := DriveInfo.Get(GetDriveToNode(Node)).DriveType;
 end; {GetDriveTypeToNode}
 
-function TDriveView.CreateDirectory(ParentNode: TTreeNode; NewName: string): TTreeNode;
-var
-  SRec: TSearchRec;
-begin
-  Assert(Assigned(ParentNode));
-
-  Result := nil;
-  if not TNodeData(ParentNode.Data).Scanned then
-    ValidateDirectory(ParentNode);
-
-  StopWatchThread;
-
-  try
-    if Assigned(FDirView) then
-      FDirView.StopWatchThread;
-
-    {create phyical directory:}
-    LastIOResult := 0;
-    if not Windows.CreateDirectory(PChar(NodePath(ParentNode) + '\' + NewName), nil) then
-      LastIOResult := GetLastError;
-    if LastIOResult = 0 then
-    begin
-      {Create treenode:}
-      FindFirst(ApiPath(NodePath(ParentNode) + '\' + NewName), faAnyFile, SRec);
-      Result := AddChildNode(ParentNode, Srec);
-      FindClose(Srec);
-      TNodeData(Result.Data).Scanned := True;
-      SortChildren(ParentNode, False);
-      ParentNode.Expand(False);
-    end;
-  finally
-    StartWatchThread;
-    if Assigned(FDirView) then
-    begin
-      FDirView.StartWatchThread;
-      FDirView.Reload2;
-    end;
-  end;
-end; {CreateDirectory}
-
-function TDriveView.DeleteDirectory(Node: TTreeNode; AllowUndo: Boolean): Boolean;
-var
-  DelDir: string;
-  OperatorResult: Boolean;
-  FileOperator: TFileOperator;
-  SaveCursor: TCursor;
-begin
-  Assert(Assigned(Node));
-
-  Result := False;
-  if Assigned(Node) and (Node.Level > 0) then
-  begin
-    SaveCursor := Screen.Cursor;
-    Screen.Cursor := crHourGlass;
-    FileOperator := TFileOperator.Create(Self);
-    DelDir := NodePathName(Node);
-    FileOperator.OperandFrom.Add(DelDir);
-    FileOperator.Operation := foDelete;
-    if AllowUndo then
-      FileOperator.Flags := FileOperator.Flags + [foAllowUndo]
-    else
-      FileOperator.Flags := FileOperator.Flags - [foAllowUndo];
-
-    if not ConfirmDelete then
-      FileOperator.Flags := FileOperator.Flags + [foNoConfirmation];
-
-    try
-      if DirectoryExists(DelDir) then
-      begin
-        StopWatchThread;
-        OperatorResult := FileOperator.Execute;
-
-        if OperatorResult and (not FileOperator.OperationAborted) and
-           (not DirectoryExists(DelDir)) then
-        begin
-          Node.Delete
-        end
-          else
-        begin
-          Result := False;
-          if not AllowUndo then
-          begin
-            {WinNT4-Bug: FindFirst still returns the directories search record, even if the
-             directory was deleted:}
-            ChDir(DelDir);
-            if IOResult <> 0 then
-              Node.Delete;
-          end;
-        end;
-      end
-        else
-      begin
-        Node.Delete;
-        Result := True;
-      end;
-    finally
-      StartWatchThread;
-      if Assigned(DirView) and Assigned(Selected) then
-        DirView.Path := NodePathName(Selected);
-      FileOperator.Free;
-      Screen.Cursor := SaveCursor;
-    end;
-  end;
-end; {DeleteDirectory}
-
 procedure TDriveView.CreateWatchThread(Drive: string);
 begin
   if csDesigning in ComponentState then