3 @implementation JubConfig
4 @synthesize domain = _domain;
5 @synthesize server = _server;;
6 @synthesize username = _username;
7 @synthesize password = _password;
9 - initWithFile: (OFString*)file
14 OFAutoreleasePool *pool = [OFAutoreleasePool new];
15 OFXMLElement *element = [OFXMLElement elementWithFile: file];
17 if (![element.name isEqual: @"config"] ||
18 ![element.namespace isEqual: CONFIG_NS]) {
19 // TODO: load default config
24 // TODO: Add error handling for missing elements
25 of_log(@"Parsed file: %@", element);
27 elementForName: @"domain"
28 namespace: CONFIG_NS] stringValue] copy];
30 elementForName: @"server"
31 namespace: CONFIG_NS] stringValue] copy];
32 _username = [[[element
33 elementForName: @"username"
34 namespace: CONFIG_NS] stringValue] copy];
35 _password = [[[element
36 elementForName: @"password"
37 namespace: CONFIG_NS] stringValue] copy];