Changeset 112 for oup/current/DataAccess


Ignore:
Timestamp:
Feb 22, 2007, 1:37:39 AM (18 years ago)
Author:
alloc
Message:
 
Location:
oup/current/DataAccess
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • oup/current/DataAccess/Access_OUP_ADB.pas

    r106 r112  
    262262      extension := fields.Strings[0];
    263263    end;
     264    if SortType in [ST_ExtNameAsc, ST_ExtNameDesc] then
     265    begin
     266      id := fields.Strings[2];
     267      name := fields.Strings[1];
     268      extension := fields.Strings[0];
     269    end;
    264270  end;
    265271
     
    275281      if (NoEmptyFiles = False) or ((Fdat_files[i].FileType and $02) = 0) then
    276282      begin
    277         if AppSettings.FilenumbersAsHex then
    278           id := IntToHex(Fdat_files[i].ID, 4)
    279         else
    280           id := FormatNumber(Fdat_files[i].ID, 5, '0');
     283        id := FormatNumber(Fdat_files[i].ID, 5, '0');
    281284        name := Fdat_files[i].Name;
    282285        extension := Fdat_files[i].Extension;
     
    286289          ST_NameAsc, ST_NameDesc: list.Add(name + ';' + id + ';' + extension);
    287290          ST_ExtAsc, ST_ExtDesc:   list.Add(extension + ';' + id + ';' + name);
     291          ST_ExtNameAsc, ST_ExtNameDesc: list.Add(name + ';' + extension + ';' + id);
    288292        end;
    289293      end;
     
    294298  begin
    295299    fields := TStringList.Create;
    296     if SortType in [ST_IDAsc, ST_NameAsc, ST_ExtAsc] then
     300    if SortType in [ST_IDAsc, ST_NameAsc, ST_ExtAsc, ST_ExtNameAsc] then
    297301      for i := 0 to list.Count - 1 do
    298302      begin
  • oup/current/DataAccess/Access_OniArchive.pas

    r105 r112  
    6060
    6161constructor TAccess_OniArchive.Create(DatFilename: String; ConnectionID: Integer; var Msg: TStatusMessages);
    62 type
    63   THeader = packed record
    64     Ident:      array[0..$13] of Byte;
    65     Files:      Integer;
    66     NamedFiles: Integer;
    67     Extensions: Integer;
    68     DataAddr:   Integer;
    69     DataSize:   Integer;
    70     NamesAddr:  Integer;
    71     NamesSize:  Integer;
    72     Ident2:     array[0..$F] of Byte;
    73   end;
    74   TFilesMap = array of packed record
    75     Extension: array[0..$3] of Char;
    76     DataAddr:  Integer;
    77     NameAddr:  Integer;
    78     FileSize:  Integer;
    79     FileType:  LongWord;
    80   end;
    81   TNamedFilesMap = array of packed record
    82     FileNumber: Integer;
    83     blubb:      Integer;
    84   end;
    8562const
    8663  header_ident1_pc: array[0..$13] of Byte =
     
    250227      extension := fields.Strings[0];
    251228    end;
     229    if SortType in [ST_ExtNameAsc, ST_ExtNameDesc] then
     230    begin
     231      id := fields.Strings[2];
     232      name := fields.Strings[1];
     233      extension := fields.Strings[0];
     234    end;
    252235  end;
    253236
     
    263246      if (NoEmptyFiles = False) or ((Fdat_files[i].FileType and $02) = 0) then
    264247      begin
    265         if AppSettings.FilenumbersAsHex then
    266           id := IntToHex(Fdat_files[i].ID, 4)
    267         else
    268           id := FormatNumber(Fdat_files[i].ID, 5, '0');
     248        id := FormatNumber(Fdat_files[i].ID, 5, '0');
    269249        name := Fdat_files[i].Name;
    270250        extension := Fdat_files[i].Extension;
     
    274254          ST_NameAsc, ST_NameDesc: list.Add(name + ';' + id + ';' + extension);
    275255          ST_ExtAsc, ST_ExtDesc:   list.Add(extension + ';' + id + ';' + name);
     256          ST_ExtNameAsc, ST_ExtNameDesc: list.Add(name + ';' + extension + ';' + id);
    276257        end;
    277258      end;
     
    282263  begin
    283264    fields := TStringList.Create;
    284     if SortType in [ST_IDAsc, ST_NameAsc, ST_ExtAsc] then
     265    if SortType in [ST_IDAsc, ST_NameAsc, ST_ExtAsc, ST_ExtNameAsc] then
    285266      for i := 0 to list.Count - 1 do
    286267      begin
  • oup/current/DataAccess/ConnectionManager.pas

    r101 r112  
    3535    function CloseConnection(ID: Integer; var Msg: TStatusMessages): Boolean; overload;
    3636    function CloseConnection(FileName: String; var Msg: TStatusMessages): Boolean; overload;
     37    function FileOpened(FileName: String): Integer;
    3738  published
    3839  end;
     
    261262
    262263
     264function TConnectionManager.FileOpened(FileName: String): Integer;
     265var
     266  i: Integer;
     267begin
     268  Result := -1;
     269  if Length(FConnections) > 0 then
     270    for i := 0 to High(FConnections) do
     271      if FConnections[i].FileName = FileName then
     272      begin
     273        Result := FConnections[i].ConnectionID;
     274        Exit;
     275      end;
     276end;
     277
     278
    263279initialization
    264280  ConManager := TConnectionManager.Create;
Note: See TracChangeset for help on using the changeset viewer.