Browse Source

MOS-8 Change pEpNotificationProtocol to PEPNotificationProtocol.

MOS-8
David Alarcon 2 years ago
parent
commit
f2526acf04
3 changed files with 8 additions and 8 deletions
  1. +5
    -5
      Submodules/pEpNotifications/pEpNotifications/AppDelegate.swift
  2. +1
    -1
      pEpMacOSAdapter/pEpMacOSAdapter.m
  3. +2
    -2
      pEpMacOSAdapter/pEpMacOSAdapterProtocol.h

+ 5
- 5
Submodules/pEpNotifications/pEpNotifications/AppDelegate.swift View File

@ -12,7 +12,7 @@ import SwiftUI
enum DNType : Int { case ready = 0, downloading, downloadArrived, noDownloadAvailable }
@objc(pEpNotificationProtocol) protocol pEpNotificationProtocol {
@objc(PEPNotificationProtocol) protocol PEPNotificationProtocol {
func notifyDownload(_ type: Int, withName: NSString, withFilename: NSString)
}
@ -24,8 +24,8 @@ enum DNType : Int { case ready = 0, downloading, downloadArrived, noDownloadAvai
func stopUpdates()
}
@objc class pEpNotification : NSObject, pEpNotificationProtocol {
var delegate: pEpNotificationProtocol!
@objc class pEpNotification : NSObject, PEPNotificationProtocol {
var delegate: PEPNotificationProtocol!
func notifyDownload(_ type: Int, withName: NSString, withFilename: NSString) {
NSLog("notifyDownload")
@ -34,7 +34,7 @@ enum DNType : Int { case ready = 0, downloading, downloadArrived, noDownloadAvai
}
@NSApplicationMain
class AppDelegate: NSObject, NSApplicationDelegate, NSUserNotificationCenterDelegate, NSXPCListenerDelegate, pEpNotificationProtocol {
class AppDelegate: NSObject, NSApplicationDelegate, NSUserNotificationCenterDelegate, NSXPCListenerDelegate, PEPNotificationProtocol {
@IBOutlet weak var pEpMenu: NSMenu!
@IBOutlet weak var statusText: NSMenuItem!
@IBOutlet weak var _updateNow: NSMenuItem!
@ -187,7 +187,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserNotificationCenterDele
}
@objc func listener(_ listener: NSXPCListener, shouldAcceptNewConnection newConnection: NSXPCConnection) -> Bool {
newConnection.exportedInterface = NSXPCInterface.init(with: pEpNotificationProtocol.self)
newConnection.exportedInterface = NSXPCInterface.init(with: PEPNotificationProtocol.self)
let obj = pEpNotification()
obj.delegate = self
newConnection.exportedObject = obj


+ 1
- 1
pEpMacOSAdapter/pEpMacOSAdapter.m View File

@ -27,7 +27,7 @@ extern pEpUpdater* updater;
if (updater) {
_clientConnection = [[NSXPCConnection alloc] initWithListenerEndpoint:endpoint];
_clientConnection.remoteObjectInterface = [NSXPCInterface
interfaceWithProtocol:@protocol(pEpNotificationProtocol)];
interfaceWithProtocol:@protocol(PEPNotificationProtocol)];
_clientConnection.interruptionHandler = ^(){NSLog(@"interruption"); updater.subscriber=nil;};
_clientConnection.invalidationHandler = ^(){NSLog(@"invalidation"); updater.subscriber=nil;};


+ 2
- 2
pEpMacOSAdapter/pEpMacOSAdapterProtocol.h View File

@ -13,7 +13,7 @@
typedef enum { ready = 0, downloading, downloadArrived, noDownloadAvailable } DNType;
/// Callback protocol to notify about download events
@protocol pEpNotificationProtocol
@protocol PEPNotificationProtocol
/// notification about download events
- (void)notifyDownload:(int)type withName:(NSString*)name withFilename:(NSString*)filename;
@ -21,7 +21,7 @@ typedef enum { ready = 0, downloading, downloadArrived, noDownloadAvailable } DN
@end
/// This is the object from the client where we deliver notifications to
@interface pEpNotification : NSObject <pEpNotificationProtocol>
@interface pEpNotification : NSObject <PEPNotificationProtocol>
@end
/// This protocol is providing the XPC interface to the User Interface program pEpNotifications


Loading…
Cancel
Save