Use SOGoSystemDefaults in all tools

sogo-ealarms-notify and sogo-slapd-sockd will now be able to use sogo.conf
Fixes #2226
pull/10/head
Jean Raby 2013-02-08 16:22:14 -05:00
parent 8981dcd645
commit 4952ff7914
2 changed files with 9 additions and 8 deletions

View File

@ -23,28 +23,29 @@
#import <Foundation/NSAutoreleasePool.h>
#import <Foundation/NSUserDefaults.h>
#import <SOGo/SOGoSystemDefaults.h>
#import "SOGoEAlarmsNotifier.h"
int
main (int argc, char **argv, char **env)
{
NSAutoreleasePool *pool;
NSUserDefaults *ud;
SOGoEAlarmsNotifier *notifier;
SOGoSystemDefaults *sogoDefaults;
int rc;
rc = 0;
pool = [NSAutoreleasePool new];
ud = [NSUserDefaults standardUserDefaults];
[ud addSuiteNamed: @"sogod"];
sogoDefaults = [SOGoSystemDefaults sharedSystemDefaults];
if ([ud objectForKey: @"SOGoEnableEMailAlarms"])
if ([sogoDefaults objectForKey: @"SOGoEnableEMailAlarms"])
{
notifier = [SOGoEAlarmsNotifier new];
if (![notifier run])
rc = -1;
rc = -1;
[notifier release];
}
else

View File

@ -23,13 +23,14 @@
#import <Foundation/NSAutoreleasePool.h>
#import <Foundation/NSUserDefaults.h>
#import <SOGo/SOGoSystemDefaults.h>
#import "SOGoSockD.h"
int
main (int argc, char **argv, char **env)
{
NSAutoreleasePool *pool;
NSUserDefaults *ud;
SOGoSockD *sockd;
int rc;
@ -37,8 +38,7 @@ main (int argc, char **argv, char **env)
pool = [NSAutoreleasePool new];
ud = [NSUserDefaults standardUserDefaults];
[ud addSuiteNamed: @"sogod"];
[SOGoSystemDefaults sharedSystemDefaults];
sockd = [SOGoSockD new];
if ([sockd run])