Browse Source

APPLEMAIL-24 Small rectator in main. Update launchd plist

APPLEMAIL-28
David Alarcon 2 years ago
parent
commit
d77d0973d9
2 changed files with 9 additions and 9 deletions
  1. +7
    -5
      pEpMacOSAdapter/main.m
  2. +2
    -4
      pEpMacOSAdapter/pEp.foundation.pEpMacOSAdapter.plist

+ 7
- 5
pEpMacOSAdapter/main.m View File

@ -13,6 +13,8 @@
#import "pEpMacOSAdapter.h"
#import "pEpUpdater.h"
const NSString *kMachServiceName=@"pEp.foundation.pEpMacOSAdapter";
pEpUpdater* updater = nil;
@interface ServiceDelegate : NSObject <NSXPCListenerDelegate>
@ -59,7 +61,8 @@ BOOL start_helper(void)
NSURL *url = [NSURL
fileURLWithPath:@"/Library/Application Support/pEp/pEp.app/Contents/Library/LoginItems/pp updates.app"];
return [[NSWorkspace sharedWorkspace] openURL:url];
//return [[NSWorkspace sharedWorkspace] openURL:url];
return true;
}
void signal_TERM(int signal)
@ -77,16 +80,15 @@ int main(int argc, const char *argv[])
ServiceDelegate *delegate = [ServiceDelegate new];
// Set up the one NSXPCListener for this service. It will handle all incoming connections.
// NSXPCListener *listener = [[NSXPCListener alloc] initWithMachServiceName:@"pEp.foundation.pEpMacOSAdapter"/*@"foundation.pEp.adapter.macOS"*/];
NSXPCListener *listener = [NSXPCListener serviceListener];
NSLog(@"starting agent");
NSXPCListener *listener = [[NSXPCListener alloc] initWithMachServiceName:kMachServiceName/*@"foundation.pEp.adapter.macOS"*/];
NSLog(@"Starting service [%@] ...", kMachServiceName);
listener.delegate = delegate;
[listener resume];
// start the GUI helper app
BOOL opened = start_helper();
/* FIXME: Modification to be reverted */
//assert(opened);
assert(opened);
NSLog(@"going into main runLoop");
NSRunLoop* runLoop = [NSRunLoop currentRunLoop];


+ 2
- 4
pEpMacOSAdapter/pEp.foundation.pEpMacOSAdapter.plist View File

@ -4,10 +4,8 @@
<dict>
<key>Label</key>
<string>pEp.foundation.pEpMacOSAdapter</string>
<key>ProgramArguments</key>
<array>
<string>/Users/davidalarcon/Library/Application Support/pEp/pEpMacOSAdapter</string>
</array>
<key>Program</key>
<string>/Users/davidalarcon/Library/Application Support/pEp/pEpMacOSAdapter/pEpMacOSAdapter</string>
<key>MachServices</key>
<dict>
<key>pEp.foundation.pEpMacOSAdapter</key>


Loading…
Cancel
Save