From e26e22d9d6a6641cfc0a35e8ae31c12aee8bea5b Mon Sep 17 00:00:00 2001 From: rowanbeentje Date: Sat, 17 Mar 2012 17:56:04 +0000 Subject: - Remove the GPL-licensed Colloquy-sourced NSNotificationAdditions category from the project, and replace with an MIT-licensed TCMPortMapper sources NSNotificationCenterThreadingAdditions category. This should fix method clashes in the SP_REFACTOR project, so remove behavioural/namespacing switches. --- Source/NSNotificationAdditions.m | 97 ---------------------------------------- 1 file changed, 97 deletions(-) delete mode 100644 Source/NSNotificationAdditions.m (limited to 'Source/NSNotificationAdditions.m') diff --git a/Source/NSNotificationAdditions.m b/Source/NSNotificationAdditions.m deleted file mode 100644 index 1b8c37eb..00000000 --- a/Source/NSNotificationAdditions.m +++ /dev/null @@ -1,97 +0,0 @@ -// -// $Id$ -// -// NSNotificationAdditions.m -// sequel-pro -// -// Copied from the Colloquy project; original code available from Trac at -// http://colloquy.info/project/browser/trunk/Additions/NSNotificationAdditions.m -// -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// More info at - -#import "NSNotificationAdditions.h" -#import "pthread.h" - -@interface NSNotificationCenter (NSNotificationCenterAdditions_PrivateAPI) -+ (void)_postNotification:(NSNotification *)aNotification; -+ (void)_postNotificationWithDetails:(NSDictionary *)anInfoDictionary; -@end - -@implementation NSNotificationCenter (NSNotificationCenterAdditions) - -- (void)postNotificationOnMainThread:(NSNotification *)aNotification -{ - if (pthread_main_np()) return [self postNotification:aNotification]; - - [self performSelectorOnMainThread:@selector(_postNotification:) withObject:aNotification waitUntilDone:NO]; -} - -- (void)postNotificationOnMainThread:(NSNotification *)aNotification waitUntilDone:(BOOL)shouldWaitUntilDone -{ - if (pthread_main_np()) return [self postNotification:aNotification]; - - [self performSelectorOnMainThread:@selector(_postNotification:) withObject:aNotification waitUntilDone:shouldWaitUntilDone]; -} - -- (void)postNotificationOnMainThreadWithName:(NSString *)aName object:(id)anObject -{ - if (pthread_main_np()) return [self postNotificationName:aName object:anObject userInfo:nil]; - - [self postNotificationOnMainThreadWithName:aName object:anObject userInfo:nil waitUntilDone:NO]; -} - -- (void)postNotificationOnMainThreadWithName:(NSString *)aName object:(id)anObject userInfo:(NSDictionary *)aUserInfo -{ - if(pthread_main_np()) return [self postNotificationName:aName object:anObject userInfo:aUserInfo]; - - [self postNotificationOnMainThreadWithName:aName object:anObject userInfo:aUserInfo waitUntilDone:NO]; -} - -- (void)postNotificationOnMainThreadWithName:(NSString *)aName object:(id)anObject userInfo:(NSDictionary *)aUserInfo waitUntilDone:(BOOL)shouldWaitUntilDone -{ - if (pthread_main_np()) return [self postNotificationName:aName object:anObject userInfo:aUserInfo]; - - NSMutableDictionary *info = [[NSMutableDictionary allocWithZone:nil] initWithCapacity:3]; - - if (aName) [info setObject:aName forKey:@"name"]; - if (anObject) [info setObject:anObject forKey:@"object"]; - if (aUserInfo) [info setObject:aUserInfo forKey:@"userInfo"]; - - [[self class] performSelectorOnMainThread:@selector(_postNotificationWithDetails:) withObject:info waitUntilDone:shouldWaitUntilDone]; -} - -@end - -@implementation NSNotificationCenter (NSNotificationCenterAdditions_PrivateAPI) - -+ (void)_postNotification:(NSNotification *)aNotification -{ - [[self defaultCenter] postNotification:aNotification]; -} - -+ (void)_postNotificationWithDetails:(NSDictionary *)anInfoDictionary -{ - NSString *name = [anInfoDictionary objectForKey:@"name"]; - id object = [anInfoDictionary objectForKey:@"object"]; - NSDictionary *userInfo = [anInfoDictionary objectForKey:@"userInfo"]; - - [[self defaultCenter] postNotificationName:name object:object userInfo:userInfo]; - - [anInfoDictionary release]; -} - -@end -- cgit v1.2.3