ViewVC Help
View File | Revision Log | View Changeset | Root Listing
root/Oni2/oup/current/DataAccess/ConnectionManager.pas
(Generate patch)

Comparing:
oup/rewrite/DataAccess/ConnectionManager.pas (file contents), Revision 97 by alloc, Mon Jan 22 23:05:45 2007 UTC vs.
oup/current/DataAccess/ConnectionManager.pas (file contents), Revision 112 by alloc, Thu Feb 22 00:37:39 2007 UTC

# Line 34 | Line 34 | type
34      function CloseConnectionByIndex(Index: Integer; var Msg: TStatusMessages): Boolean; overload;
35      function CloseConnection(ID: Integer; var Msg: TStatusMessages): Boolean; overload;
36      function CloseConnection(FileName: String; var Msg: TStatusMessages): Boolean; overload;
37 +    function FileOpened(FileName: String): Integer;
38    published
39    end;
40  
# Line 149 | Line 150 | begin
150  
151    ext := UpperCase(ExtractFileExt(FileName));
152  
153 <  if ext = 'ODB' then
153 >  if ext = '.OLDB' then
154      backend := DB_ADB
155 <  else if ext = 'DAT' then
155 >  else if ext = '.DAT' then
156      backend := DB_ONI
157    else
158    begin
# Line 172 | Line 173 | begin
173    begin
174      FLastID := FConnections[i].ConnectionID;
175      Result := FLastID;
176 +    Msg := SM_OK;
177    end
178    else
179    begin
# Line 179 | Line 181 | begin
181      FConnections[i].Free;
182      FConnections[i] := nil;
183      SetLength(FConnections, Length(FConnections) - 1);
184 <    Msg := SM_UnknownError;
184 >    Msg := CreateMsg;
185    end;
186   end;
187  
# Line 259 | Line 261 | begin
261   end;
262  
263  
264 + function TConnectionManager.FileOpened(FileName: String): Integer;
265 + var
266 +  i: Integer;
267 + begin
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;
276 + end;
277 +
278 +
279   initialization
280    ConManager := TConnectionManager.Create;
281   finalization

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)