Browse Source

Unused code

Source commit: 4d5150289180d21f139fc4778a17c12a9740f566
Martin Prikryl 2 days ago
parent
commit
badd4f404a

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

@@ -40,9 +40,6 @@ uses
   DragDrop, Messages, ListViewColProperties, CommCtrl, DragDropFilesEx,
   FileCtrl, SysUtils, BaseUtils, Controls, CustomDriveView, System.Generics.Collections, Winapi.ShellAPI;
 
-type
-  TVolumeDisplayStyle = (doPrettyName, doDisplayName); // Diplaytext of drive node
-
 const
   msThreadChangeDelay = 10; // TDiscMonitor: change delay
   MaxWaitTimeOut = 10; // TFileDeleteThread: wait nn seconds for deleting files or directories

+ 1 - 31
source/packages/filemng/DriveView.pas

@@ -148,8 +148,6 @@ type
     FConfirmOverwrite: Boolean;
     FWatchDirectory: Boolean;
     FDirectory: string;
-    FShowVolLabel: Boolean;
-    FVolDisplayStyle: TVolumeDisplayStyle;
     FChangeFlag: Boolean;
     FLastDir: string;
     FValidateFlag: Boolean;
@@ -212,7 +210,6 @@ type
   protected
     procedure SetSelected(Node: TTreeNode);
     procedure SetWatchDirectory(Value: Boolean);
-    procedure SetShowVolLabel(ShowIt: Boolean);
     procedure SetDirView(Value: TDirView);
     procedure SetDirectory(Value: string); override;
     function  DoScanDir(FromNode: TTreeNode): Boolean;
@@ -276,7 +273,6 @@ type
     function GetDriveStatus(Drive: string): TDriveStatus;
     function GetDriveTypetoNode(Node: TTreeNode): Integer;  // Returns DRIVE_CDROM etc..
     function GetDriveToNode(Node: TTreeNode): string;
-    function GetDriveText(Drive: string): string;
     procedure ScanDrive(Drive: string);
     function GetDrives: TStrings;
 
@@ -332,8 +328,6 @@ type
     property WatchDirectory: Boolean read FWatchDirectory write SetWatchDirectory default False;
     // Linked component TDirView:
     property DirView: TDirView read FDirView write SetDirView;
-    // Show the volume labels of drives:
-    property ShowVolLabel: Boolean read FShowVolLabel write SetShowVolLabel default True;
     // Additional events:
     property OnDisplayContextMenu: TNotifyEvent read FOnDisplayContextMenu
       write FOnDisplayContextMenu;
@@ -834,7 +828,6 @@ begin
   FDelayedNodeTimer.Interval := 250;
   FDelayedNodeTimer.OnTimer := DelayedNodeTimer;
 
-  FShowVolLabel := True;
   FChangeFlag := False;
   FLastDir := EmptyStr;
   FValidateFlag := False;
@@ -1447,21 +1440,6 @@ begin
   TNodeData(Node.Data).IconEmpty := False;
 end; // SetImageIndex
 
-function TDriveView.GetDriveText(Drive: string): string;
-begin
-  if FShowVolLabel and (Length(DriveInfo.GetPrettyName(Drive)) > 0) then
-  begin
-    case FVolDisplayStyle of
-      doPrettyName:  Result := DriveInfo.GetPrettyName(Drive);
-      doDisplayName: Result := DriveInfo.GetDisplayName(Drive);
-    end;
-  end
-    else
-  begin
-    Result := DriveInfo.GetSimpleName(Drive);
-  end;
-end;
-
 function CompareDrive(List: TStringList; Index1, Index2: Integer): Integer;
 var
   Drive1, Drive2: string;
@@ -2619,21 +2597,13 @@ begin
   if (not Assigned(Node)) or (not Assigned(Node.Data)) then
     raise ENodeNotAssigned.Create(Format(ErrorNodeNA, ['GetDisplayName']));
 
-  if not Assigned(Node.Parent) then Result := GetDriveText(GetDriveToNode(Node))
+  if not Assigned(Node.Parent) then Result := DriveInfo.GetPrettyName(GetDriveToNode(Node))
     else
   begin
     Result := GetDirName(Node);
   end;
 end;
 
-procedure TDriveView.SetShowVolLabel(ShowIt: Boolean);
-begin
-  if ShowIt = FShowVolLabel then
-    Exit;
-  FShowVolLabel := ShowIt;
-  RefreshRootNodes(True);
-end;
-
 procedure TDriveView.DisplayContextMenu(Node: TTreeNode; Point: TPoint);
 var
   Verb: string;

+ 3 - 4
source/packages/filemng/IEDriveInfo.pas

@@ -569,11 +569,10 @@ begin
     if Length(Get(Drive).PrettyName) = 0 then
       ReadDriveStatus(Drive, dsDisplayName);
     Result := Get(Drive).PrettyName;
-  end
-    else
-  begin
-    Result := GetSimpleName(Drive);
   end;
+
+  if Length(Result) = 0 then
+    Result := GetSimpleName(Drive);
 end; {TDriveInfo.GetPrettyName}
 
 function TDriveInfo.GetSimpleName(Drive: string): string;