| 33 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 34 | 
   | 
 implementation | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 35 | 
   | 
 {$R *.dfm} | 
 
 
 
 
 
 
 
 
 
 
 
 | 36 | 
 < | 
 uses _MetaManager, _FileTypes, Data; | 
 
 
 
 
 
 
 
 
 
 | 36 | 
 > | 
 uses _MetaManager, _MetaTypes, ConnectionManager, Data; | 
 
 
 
 
 
 
 
 
 
 
 
 | 37 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 38 | 
   | 
 type | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 39 | 
   | 
   PNodeData = ^TNodeData; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 56 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 57 | 
   | 
 procedure TForm_Meta.NewCon(ID: Integer); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 58 | 
   | 
 var | 
 
 
 
 
 
 
 
 
 
 | 59 | 
 – | 
   a,b,c: Int64; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 59 | 
   | 
   i: Integer; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 60 | 
   | 
   data: TNodeData; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 61 | 
   | 
   node: PVirtualNode; | 
 
 
 
 
 
 
 
 
 | 62 | 
 + | 
   Meta: TMetaManager; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 63 | 
   | 
 begin | 
 
 
 
 
 
 
 
 
 
 | 64 | 
 – | 
 { | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 64 | 
   | 
   if ID >= 0 then | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 65 | 
   | 
   begin | 
 
 
 
 
 
 
 
 
 
 | 67 | 
 – | 
     QueryPerformanceFrequency(c); | 
 
 
 
 
 
 
 
 
 
 | 68 | 
 – | 
     QueryPerformanceCounter(a); | 
 
 
 
 
 
 
 
 
 
 | 69 | 
 – | 
     if not Assigned(Meta) then | 
 
 
 
 
 
 
 
 
 
 | 70 | 
 – | 
       Meta := TMetaManager.Create(ID, Self); | 
 
 
 
 
 
 
 
 
 
 | 71 | 
 – | 
     QueryPerformanceCounter(b); | 
 
 
 
 
 
 
 
 
 
 | 72 | 
 – | 
     ShowMessage('Loading Done - ' + FloatToStr((b-a)/c) + 's'); | 
 
 
 
 
 
 
 
 
 
 | 73 | 
 – | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 66 | 
   | 
     VST.Clear; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 67 | 
   | 
     VST.BeginUpdate; | 
 
 
 
 
 
 
 
 
 | 68 | 
 + | 
     Meta := ConManager.Connection[ID].MetaData; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 69 | 
   | 
     for i := 0 to Meta.FileCount - 1 do | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 70 | 
   | 
     begin | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 71 | 
   | 
       if Assigned(Meta.FileById[i]) then | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 78 | 
   | 
     end; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 79 | 
   | 
     VST.EndUpdate; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 80 | 
   | 
   end; | 
 
 
 
 
 
 
 
 
 
 | 88 | 
 – | 
 } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 81 | 
   | 
 end; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 82 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 83 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 89 | 
   | 
   newnode: PVirtualNode; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 90 | 
   | 
   i: Integer; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 91 | 
   | 
   id: Integer; | 
 
 
 
 
 
 
 
 
 | 92 | 
 + | 
   Meta: TMetaManager; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 93 | 
   | 
 begin | 
 
 
 
 
 
 
 
 
 
 
 
 | 94 | 
 < | 
 { | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 95 | 
 < | 
   data := VST.GetNodeData(node); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 96 | 
 < | 
   for i := 0 to Meta.FileById[TFile(data.Field).FileID].ChildCount - 1 do | 
 
 
 
 
 
 
 
 
 
 | 94 | 
 > | 
   data := Sender.GetNodeData(node); | 
 
 
 
 
 
 | 95 | 
 > | 
   Meta := ConManager.Connection[ID].MetaData; | 
 
 
 
 
 
 | 96 | 
 > | 
   for i := 0 to TFile(data.Field).ChildCount - 1 do | 
 
 
 
 
 
 
 
 
 
 
 
 | 97 | 
   | 
   begin | 
 
 
 
 
 
 
 
 
 
 
 
 | 98 | 
 < | 
     id := Meta.FileById[TFile(data.Field).FileID].LinkByIndex[i].DestID; | 
 
 
 
 
 
 
 
 
 
 | 98 | 
 > | 
     id := TFile(data.Field).LinkByIndex[i].DestID; | 
 
 
 
 
 
 
 
 
 
 
 
 | 99 | 
   | 
     Meta.InitFile(id); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 100 | 
   | 
     newdata.Field := Meta.FileById[id]; | 
 
 
 
 
 
 
 
 
 
 
 
 | 101 | 
 < | 
     newnode := AddVSTEntry(VST, Node, newdata); | 
 
 
 
 
 
 
 
 
 
 | 101 | 
 > | 
     newnode := AddVSTEntry(TCustomVirtualStringTree(Sender), Node, newdata); | 
 
 
 
 
 
 
 
 
 
 
 
 | 102 | 
   | 
     if Meta.FileById[id].ChildCount > 0 then | 
 
 
 
 
 
 
 
 
 
 
 
 | 103 | 
 < | 
       VST.HasChildren[newnode] := True; | 
 
 
 
 
 
 
 
 
 
 | 103 | 
 > | 
       Sender.HasChildren[newnode] := True; | 
 
 
 
 
 
 
 
 
 
 
 
 | 104 | 
   | 
   end; | 
 
 
 
 
 
 
 
 
 
 
 
 | 105 | 
 < | 
   ChildCount := Meta.FileById[TFile(data.Field).FileID].ChildCount; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 113 | 
 < | 
 } | 
 
 
 
 
 
 
 
 
 
 | 105 | 
 > | 
   ChildCount := Sender.ChildCount[Node]; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 106 | 
   | 
 end; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 107 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 108 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 171 | 
   | 
         begin | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 172 | 
   | 
           if Data.Field is TFile then | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 173 | 
   | 
           begin | 
 
 
 
 
 
 
 
 
 
 
 
 | 174 | 
 < | 
             CellText := TFile(Data.Field).FileName; | 
 
 
 
 
 
 
 
 
 
 | 174 | 
 > | 
             CellText := TFile(Data.Field).FileInfo.Name; | 
 
 
 
 
 
 
 
 
 
 
 
 | 175 | 
   | 
             if CellText = '' then | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 176 | 
   | 
               CellText := 'Unnamed'; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 177 | 
   | 
           end; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 179 | 
   | 
       1: | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 180 | 
   | 
         begin | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 181 | 
   | 
           if Data.Field is TFile then | 
 
 
 
 
 
 
 
 
 
 
 
 | 182 | 
 < | 
             CellText := TFile(Data.Field).FileExt; | 
 
 
 
 
 
 
 
 
 
 | 182 | 
 > | 
             CellText := TFile(Data.Field).FileInfo.Extension; | 
 
 
 
 
 
 
 
 
 
 
 
 | 183 | 
   | 
         end; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 184 | 
   | 
       2: | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 185 | 
   | 
         begin | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 186 | 
   | 
           if Data.Field is TFile then | 
 
 
 
 
 
 
 
 
 
 
 
 | 187 | 
 < | 
             CellText := IntToStr(TFile(Data.Field).FileID); | 
 
 
 
 
 
 
 
 
 
 | 187 | 
 > | 
             CellText := IntToStr(TFile(Data.Field).FileInfo.ID); | 
 
 
 
 
 
 
 
 
 
 
 
 | 188 | 
   | 
         end; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 189 | 
   | 
     end; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 190 | 
   | 
   end; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 205 | 
   | 
         begin | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 206 | 
   | 
           if Data.Field is TFile then | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 207 | 
   | 
           begin | 
 
 
 
 
 
 
 
 
 
 
 
 | 208 | 
 < | 
             if Length(TFile(Data.Field).FileName) = 0 then | 
 
 
 
 
 
 
 
 
 
 | 208 | 
 > | 
             if Length(TFile(Data.Field).FileInfo.Name) = 0 then | 
 
 
 
 
 
 
 
 
 
 
 
 | 209 | 
   | 
               TargetCanvas.Font.Color := $C06060; | 
 
 
 
 
 
 
 
 
 
 
 
 | 210 | 
 < | 
             if TFile(Data.Field).FileSize = 0 then | 
 
 
 
 
 
 
 
 
 
 | 210 | 
 > | 
             if TFile(Data.Field).FileInfo.Size = 0 then | 
 
 
 
 
 
 
 
 
 
 
 
 | 211 | 
   | 
               TargetCanvas.Font.Color := $2020A0; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 212 | 
   | 
           end; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 213 | 
   | 
         end; |