소스 검색

FIX: Don't show disk free space for network path

Alexander Koblov 11 년 전
부모
커밋
32203bb10d
1개의 변경된 파일11개의 추가작업 그리고 0개의 파일을 삭제
  1. 11 0
      src/filesources/winnet/uwinnetfilesource.pas

+ 11 - 0
src/filesources/winnet/uwinnetfilesource.pas

@@ -42,6 +42,8 @@ type
     function GetRootDir(sPath: String): String; override; overload;
     function GetRootDir: String; override; overload;
 
+    function GetFreeSpace(Path: String; out FreeSize, TotalSize : Int64) : Boolean; override;
+
     // Retrieve some properties of the file source.
     function GetProperties: TFileSourceProperties; override;
 
@@ -131,6 +133,15 @@ begin
   Result:= PathDelim;
 end;
 
+function TWinNetFileSource.GetFreeSpace(Path: String; out FreeSize,
+                                        TotalSize: Int64): Boolean;
+begin
+  if IsNetworkPath(Path) then
+    Result:= False
+  else
+    Result:= inherited GetFreeSpace(Path, FreeSize, TotalSize);
+end;
+
 function TWinNetFileSource.GetProperties: TFileSourceProperties;
 begin
   Result := inherited GetProperties + [fspVirtual];