Просмотр исходного кода

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

Alexander Koblov 11 лет назад
Родитель
Сommit
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];