Changeset 361 for PersistentData/Backend
- Timestamp:
- May 8, 2012, 10:24:35 PM (13 years ago)
- Location:
- PersistentData/Backend
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
PersistentData/Backend/UPDClientINI.pas
r345 r361 13 13 14 14 TPDClientINI = class(TPDClient) 15 public 15 16 IniFile: TIniFile; 16 17 //procedure GetItemList(Condition: TCondition; ItemList: TItemList); override; 17 18 //procedure SetItemList(Condition: TCondition; ItemList: TItemList); override; 18 19 FileName: string; 19 constructor Create ; override;20 constructor Create(AOwner: TComponent); override; 20 21 destructor Destroy; override; 21 22 procedure Connect; override; … … 39 40 end;*) 40 41 41 constructor TPDClientINI.Create ;42 constructor TPDClientINI.Create(AOwner: TComponent); 42 43 begin 43 inherited Create; 44 inherited; 45 BackendName := 'INI'; 44 46 end; 45 47 -
PersistentData/Backend/UPDClientMySQL.pas
r345 r361 14 14 TPDClientMySQL = class(TPDClient) 15 15 protected 16 FHost: string; 17 FPort: Word; 18 FUser: string; 19 FPassword: string; 20 FDatabase: TSqlDatabase; 16 21 procedure InitSystemTypes; override; 17 22 function GetConnected: Boolean; override; 18 23 procedure Init; override; 19 24 public 20 Database: TSqlDatabase;21 25 procedure ObjectLoad(AObject: TObjectProxy); override; 22 26 procedure ObjectSave(AObject: TObjectProxy); override; … … 29 33 procedure Install; 30 34 procedure Uninstall; 31 constructor Create ; override;35 constructor Create(AOwner: TComponent); override; 32 36 destructor Destroy; override; 33 37 procedure Connect; override; 34 38 procedure Disconnect; override; 39 published 40 property Database: TSqlDatabase read FDatabase write FDatabase; 41 property Host: string read FHost write FHost; 42 property Port: Word read FPort write FPort; 43 property User: string read FUser write FUser; 44 property Password: string read FPassword write FPassword; 35 45 end; 36 46 … … 236 246 end; 237 247 238 constructor TPDClientMySQL.Create ;248 constructor TPDClientMySQL.Create(AOwner: TComponent); 239 249 begin 240 250 inherited; 241 Database := TSqlDatabase.Create(nil); 251 FDatabase := TSqlDatabase.Create(nil); 252 BackendName := 'MySQL'; 242 253 end; 243 254 244 255 destructor TPDClientMySQL.Destroy; 245 256 begin 246 FreeAndNil( Database);257 FreeAndNil(FDatabase); 247 258 inherited Destroy; 248 259 end; … … 250 261 procedure TPDClientMySQL.Connect; 251 262 begin 252 Database.Port := Port; 253 Database.UserName := User; 254 Database.Password := Password; 255 Database.HostName := Host; 256 Database.Database := Schema; 257 Database.Connect; 258 Init; 263 if not Connected then begin 264 Database.Port := Port; 265 Database.UserName := User; 266 Database.Password := Password; 267 Database.HostName := Host; 268 Database.Database := Schema; 269 Database.Connect; 270 Init; 271 end; 259 272 end; 260 273 261 274 procedure TPDClientMySQL.Disconnect; 262 275 begin 263 Database.Disconnect;276 if Connected then Database.Disconnect; 264 277 end; 265 278 -
PersistentData/Backend/UPDClientRegistry.pas
r345 r361 16 16 //procedure GetItemList(Condition: TCondition; ItemList: TItemList); override; 17 17 //procedure SetItemList(Condition: TCondition; ItemList: TItemList); override; 18 constructor Create ; override;18 constructor Create(AOwner: TComponent); override; 19 19 destructor Destroy; override; 20 20 end; … … 36 36 end;*) 37 37 38 constructor TPDClientRegistry.Create ;38 constructor TPDClientRegistry.Create(AOwner: TComponent); 39 39 begin 40 inherited; 40 41 Reg := TRegistry.Create; 41 inherited Create;42 BackendName := 'Windows registry'; 42 43 end; 43 44 -
PersistentData/Backend/UPDClientXMLRPC.pas
r340 r361 13 13 14 14 TPDClientXMLRPC = class(TPDClient) 15 constructor Create(AOwner: TComponent); override; 15 16 end; 16 17 … … 18 19 19 20 21 { TPDClientXMLRPC } 22 23 constructor TPDClientXMLRPC.Create(AOwner: TComponent); 24 begin 25 inherited Create(AOwner); 26 BackendName := 'XMLRPC'; 27 end; 28 20 29 end. 21 30
Note:
See TracChangeset
for help on using the changeset viewer.