Index: oup/current/Code/OniDataClass.pas
===================================================================
--- oup/current/Code/OniDataClass.pas	(revision 86)
+++ oup/current/Code/OniDataClass.pas	(revision 87)
@@ -1,5 +1,5 @@
 unit OniDataClass;
 interface
-uses Data, DataStructures, Classes, SysUtils, StrUtils,
+uses Data, Classes, SysUtils, StrUtils,
   Dialogs, ABSDecUtil, ABSMain, DB, Windows;
 
@@ -21,5 +21,5 @@
     procedure Close; virtual; abstract;
 
-    function GetFileInfo(fileid: LongWord): TFileInfo; virtual; abstract;
+    function GetFileInfo(fileid: Integer): TFileInfo; virtual;
     function GetFilesList(ext: String; pattern: String;
       NoEmptyFiles: Boolean; sort: TSortType): TStringArray; virtual; abstract;
@@ -73,5 +73,5 @@
     procedure Close; override;
 
-    function GetFileInfo(fileid: LongWord): TFileInfo; override;
+    function GetFileInfo(fileid: Integer): TFileInfo; override;
     function GetFilesList(ext: String; pattern: String;
       NoEmptyFiles: Boolean; sort: TSortType): TStringArray; override;
@@ -112,5 +112,5 @@
     procedure UpdateListCache;
     //      function GetDatLinks(srcid:LongWord):TDatLinks;
-    function GetFileInfo(fileid: LongWord): TFileInfo; override;
+    function GetFileInfo(fileid: Integer): TFileInfo; override;
     function GetFilesList(ext: String; pattern: String;
       NoEmptyFiles: Boolean; sort: TSortType): TStringArray; override;
@@ -142,29 +142,5 @@
     constructor Create(OLDBFilename: String; var Result: Boolean); override;
     procedure Close; override;
-{
-    procedure UpdateListCache;
-    //      function GetDatLinks(srcid:LongWord):TDatLinks;
-    function GetFileInfo(fileid: LongWord): TFileInfo; override;
-    function GetFilesList(ext: String; pattern: String;
-      NoEmptyFiles: Boolean; sort: TSortType): TStringArray; override;
-    function GetFilesCount: LongWord; override;
-    function GetExtensionsList: TStringArray; override;
-    function GetExtendedExtensionsList: TExtensionsMap; override;
-    function GetNamedFilesMap: TNamedFilesMap;
-
-    function LoadDatFile(fileid: LongWord): Tdata; override;
-    procedure UpdateDatFile(fileid: LongWord; Data: Tdata); override;
-    procedure LoadDatFilePart(fileid, offset, size: LongWord; target: Pointer); override;
-    procedure UpdateDatFilePart(fileid, offset, size: LongWord; target: Pointer); override;
-
-    function GetRawList(fileid: LongWord): TRawList; override;
-    procedure LoadRawFile(fileid, dat_offset: LongWord; target: Pointer); override;
-    procedure UpdateRawFile(fileid, dat_offset: LongWord; size: LongWord;
-      target: Pointer); override;
-    procedure LoadRawFilePart(fileid, dat_offset: LongWord;
-      offset, size: LongWord; target: Pointer); override;
-    procedure UpdateRawFilePart(fileid, dat_offset: LongWord;
-      offset, size: LongWord; target: Pointer); override;
-}  published
+  published
   end;
 
@@ -181,4 +157,5 @@
 function CreateDataConnection(filename: String; backend: Integer): TOniData;
 procedure CloseDataConnection(connection: TOniData);
+function GetEmptyFileInfo: TFileInfo;
 
 
@@ -187,5 +164,5 @@
 
 implementation
-uses Functions;
+uses DataStructures, Functions;
 
 
@@ -252,4 +229,16 @@
 
 
+function TOniData.GetFileInfo(fileid: Integer): TFileInfo;
+begin
+  Result.ID := -1;
+  Result.FileName := '';
+  Result.FileNameHex := '';
+  Result.Extension := '';
+  Result.Name := '';
+  Result.Size := 0;
+  Result.FileType := 0;
+  Result.DatAddr := 0;
+  Result.opened := False;
+end;
 
 
@@ -378,6 +367,11 @@
 
 
-function TOniDataDat.GetFileInfo(fileid: LongWord): TFileInfo;
-begin
+function TOniDataDat.GetFileInfo(fileid: Integer): TFileInfo;
+begin
+  if fileid = -1 then
+  begin
+    Result := inherited GetFileInfo(fileid);
+    Exit;
+  end;
   if fileid < Self.GetFilesCount then
     Result    := Fdat_files[fileid]
@@ -592,5 +586,5 @@
       if RawListHandlers[i].needed then
       begin
-        Result := RawListHandlers[i].Handler(fileid);
+        Result := RawListHandlers[i].Handler(Self, fileid);
         Break;
       end
@@ -961,8 +955,13 @@
 
 
-function TOniDataADB.GetFileInfo(fileid: LongWord): TFileInfo;
+function TOniDataADB.GetFileInfo(fileid: Integer): TFileInfo;
 var
   i: Integer;
 begin
+  if fileid = -1 then
+  begin
+    Result := inherited GetFileInfo(fileid);
+    Exit;
+  end;
   if fileid < Self.GetFilesCount then
   begin
@@ -1484,5 +1483,5 @@
         begin
           DataConnections[i].Close;
-          DataConnections[i].Free;
+//          DataConnections[i].Free;
           DataConnections[i] := nil;
           found := True;
@@ -1500,4 +1499,18 @@
 
 
+function GetEmptyFileInfo: TFileInfo;
+begin
+  Result.ID := -1;
+  Result.FileName := '';
+  Result.FileNameHex := '';
+  Result.Extension := '';
+  Result.Name := '';
+  Result.Size := 0;
+  Result.FileType := 0;
+  Result.DatAddr := 0;
+  Result.opened := False;
+end;
+
+
 
 
