[28905] users/rhwood/Pallet

source_changes at macosforge.org source_changes at macosforge.org
Tue Sep 11 01:48:02 PDT 2007


Revision: 28905
          http://trac.macosforge.org/projects/macports/changeset/28905
Author:   rhwood at macports.org
Date:     2007-09-11 01:48:02 -0700 (Tue, 11 Sep 2007)

Log Message:
-----------
Remove gobs of cruft from an attempt to see if Pallet should use the old dp-cocoa internal design patterns.

Modified Paths:
--------------
    users/rhwood/Pallet/PortAuthority.h
    users/rhwood/Pallet/PortAuthority.m

Modified: users/rhwood/Pallet/PortAuthority.h
===================================================================
--- users/rhwood/Pallet/PortAuthority.h	2007-09-11 08:36:54 UTC (rev 28904)
+++ users/rhwood/Pallet/PortAuthority.h	2007-09-11 08:48:02 UTC (rev 28905)
@@ -38,7 +38,6 @@
 @interface PortAuthority : NSObject <TaskWrapperController>
 
 {
-	NSDictionary *_ports;
 	
     IBOutlet NSTableView *portsList;
     IBOutlet NSTextView *portInfo;
@@ -77,8 +76,6 @@
 	MPMacPorts *macPorts;
 }
 
-- (NSDictionary *)tPorts;
-
 - (IBAction)installPort:(id)sender;
 - (IBAction)reinstallPort:(id)sender;
 - (IBAction)removePort:(id)sender;
@@ -98,9 +95,6 @@
 - (IBAction)macPortsSite:(id)sender;
 - (IBAction)portAuthoritySite:(id)sender;
 
-//- (id <MPAgentProtocol>)agent;
-- (void)connectionDidDie:(id)server;
-
 - (void)getPortIndexes;
 - (NSString *)pathToPortIndexWithSource:(NSString *)source;
 - (void)populatePortIndex;
@@ -110,17 +104,4 @@
 
 - (void)parsePortIndex:(NSString *)portIndex intoIndexObject:(id)indexObject;
 
-#pragma mark MACPORTS INTERPETER
-/*
-- (NSDictionary *)listPorts:(NSString *)query;
-- (MPObject *)ui_puts:(NSArray *)array;
-*/
-#pragma mark MACPORTS AGENT
-/*
-- (oneway void)displayMessage:(in bycopy NSDictionary *)message forPortName:(in bycopy NSString *)portName;
-- (void)executeTarget:(NSString *)target forPortName:(NSString *)portName;
-- (BOOL)shouldPerformTarget:(in bycopy NSString *)target forPortName:(in bycopy NSString *)portName;
-- (oneway void)willPerformTarget:(in bycopy NSString *)target forPortName:(in bycopy NSString *)portName;
-- (oneway void)didPerformTarget:(in bycopy NSString *)target forPortName:(in bycopy NSString *)portName withResult:(in bycopy NSString *)result;
-*/
 @end

Modified: users/rhwood/Pallet/PortAuthority.m
===================================================================
--- users/rhwood/Pallet/PortAuthority.m	2007-09-11 08:36:54 UTC (rev 28904)
+++ users/rhwood/Pallet/PortAuthority.m	2007-09-11 08:48:02 UTC (rev 28905)
@@ -112,22 +112,6 @@
 
 #pragma mark PORT INDEX
 
-- (NSDictionary *)tPorts
-{
-	if (!_ports) {
-		NSPropertyListFormat format;
-		NSString *error;
-		NSData *portsData = [[self agent] portsData];
-		_ports= [[NSPropertyListSerialization propertyListFromData:portsData
-												  mutabilityOption:NSPropertyListMutableContainersAndLeaves
-															format:&format
-												  errorDescription:&error]
-			retain];
-	}
-	NSLog(_ports);
-	return _ports;
-}
-
 - (void)getPortIndexes
 {
 	NSMutableDictionary *sources;
@@ -577,150 +561,6 @@
 	return YES;
 }
 
-#pragma mark MACPORTS INTERPETER
-/*
-- (NSDictionary *)listPorts:(NSString *)query
-{    
-    Tcl_Obj **objv;
-    int count = 0, i=0;
-    MPObject *result;
-    NSString *error;
-    NSMutableDictionary *portsData;
-
-	//    [_ports removeAllObjects];
-    result = [interpeter evaluateCommand:[MPObject objectWithString:MPSearchCommand] 
-							  withObject:[MPObject objectWithString:query]];
-    Tcl_ListObjGetElements(NULL, [result tclObj], &count, &objv);	
-    while (++i < count) {	
-        NSMutableDictionary *portDict = [NSMutableDictionary dictionary];
-        Tcl_Obj **innerobjs;
-        int innercount = 0, j = 0;    
-        Tcl_ListObjGetElements(NULL, objv[i++], &innercount, &innerobjs);
-        while (j < innercount)
-        {
-            MPObject *keyObject = [MPObject objectWithTclObj: innerobjs[j++]];
-            MPObject *valueObject = [MPObject objectWithTclObj: innerobjs[j++]];
-            NSString *key = [keyObject stringValue];
-            id value;
-            if ([key isEqualToString: MPCategoriesKey] || [key isEqualToString: MPMaintainersKey]) {
-                NSEnumerator *enm = [[[valueObject stringValue] componentsSeparatedByString: @" "] objectEnumerator];
-                NSString *component;
-                value = [NSMutableArray array];
-                while (component = [enm nextObject]) {
-                    if (![value containsObject: component]) {
-                        [value addObject: component];
-                    }
-                }
-            } else if ([key rangeOfString: MPDependsKey].location != NSNotFound) {
-                NSEnumerator *dependencyEnm = [[[valueObject stringValue] componentsSeparatedByString: @" "] objectEnumerator];
-                NSString *component;
-                value = [NSMutableArray array];
-                while (component = [dependencyEnm nextObject]) {
-                    NSString *dependencyName = [[component componentsSeparatedByString: @":"] objectAtIndex: 2];
-                    if (![value containsObject: dependencyName]) {
-                        [value addObject: dependencyName];
-                    }
-                }
-                key = MPDependsKey;
-            } else {
-                value = [valueObject stringValue];
-            }
-            [portDict setObject:value forKey:key];
-        }
-        [portsData setObject:portDict forKey:[portDict objectForKey:MPNameKey]];
-    }
-    return [NSDictionary dictionaryWithDictionary:portsData];
-}
-
-- (MPObject *) ui_puts: (NSArray *)array 
-{
-    NSDictionary *message = [[array objectAtIndex: 1] dictionaryValue];
-    if (message == nil)
-    	return [MPObject objectWithString: MPNoResult];
-	
-    NSString *data = [message objectForKey: @"data"];
-    NSString *priority = [message objectForKey: @"priority"];
-    if (data == nil || priority == nil)
-    	return [MPObject objectWithString: MPNoResult];
-	
-    id delegate = [[[NSThread currentThread] threadDictionary] objectForKey: @"delegate"];
-    //[delegate displayMessage: message forPortName: [_currentOp objectForKey: @"portName"]];
-    return [MPObject objectWithString: MPYesResult];
-}
-*/
-#pragma mark MACPORTS AGENT
-/*
-- (id <MPAgentProtocol>)agent {
-	if (agentIsBusy) {
-		return nil;
-	}
-	agentIsBusy = YES;
-	if (!agent) {
-		NSString *agentPath = [[NSBundle mainBundle] pathForResource:@"PalletHelper" ofType:@""];
-		int i;
-//		[self launchAuthorizedExecutableWithArguments:];
-		[agentTask setArguments:[NSArray arrayWithObjects:agentPath, nil]];
-		[agentTask authorizeWithQuery];
-		[agentTask start];
-		for (i = 0; i < 10; i++) {
-			connection = [[NSConnection connectionWithRegisteredName:MPAgentMessagePort host:nil] retain];
-			if (connection) {
-				break;
-			}
-			sleep(1);
-		}
-		if (!connection) {
-			NSRunAlertPanel(@"Pallet", @"Could not connect to PalletHelper.", nil, nil, nil);
-			// exit(0); don't exit as I want to see the bloody console window
-		}
-		agent = [[connection rootProxy] retain];
-		[(NSDistantObject *)agent setProtocolForProxy:@protocol(MPAgentProtocol)];
-		[connection setRootObject:self];
-		[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(connectionDidDie:) name:NSConnectionDidDieNotification object:connectionInvalid];
-	}
-	agentIsBusy = NO;
-	return agent;
-}
-
-- (void)connectionDidDie:(id)server
-{
-    NSRunAlertPanel(@"Pallet", @"Connection to PalletHelper died!", nil, nil, nil);
-    agent = nil;
-    // resetting agent to nil will cause a new instance of the agent to
-    // be spawned by [PortAuthority agent] next time someone tries to access it
-}
-
-- (oneway void)displayMessage:(in bycopy NSDictionary *)message forPortName:(in bycopy NSString *)portName {
-	[self appendOutput:[message objectForKey:@"data"]];
-}
-
-- (void)executeTarget:(NSString *)target forPortName:(NSString *)portName {
-	NSDictionary *operation = [[NSMutableDictionary alloc] initWithObjectsAndKeys:
-		portName, @"portName",
-		target, "@target",
-		nil];
-	if (!operations) {
-		operations = [[NSMutableArray alloc] init];
-	}
-	[operations addObject:operation];
-	[[self agent] executeTarget:target forPortName:portName];
-}
-
-- (BOOL)shouldPerformTarget:(in bycopy NSString *)target forPortName:(in bycopy NSString *)portName {
-	return YES;
-}
-
-- (oneway void)willPerformTarget:(in bycopy NSString *)target forPortName:(in bycopy NSString *)portName {
-	[progressIndicator startAnimation:nil];
-	[NSApp setApplicationIconImage:[NSImage imageNamed:@"ApplicationIconBusy"]];
-}
-
-- (oneway void)didPerformTarget:(in bycopy NSString *)target forPortName:(in bycopy NSString *)portName withResult:(in bycopy NSString *)result {
-	[progressIndicator stopAnimation:nil];
-	[NSApp setApplicationIconImage:[NSImage imageNamed:@"ApplicationIcon"]];
-	[status setStringValue:@""];
-}
-*/
 #pragma mark AUTHORIZED EXECUTABLE DELEGATES / TASK WRAPPER CONTROLLER
 // This callback is implemented as part of conforming to the ProcessController protocol.
 // It will be called whenever there is output from the TaskWrapper.
@@ -808,5 +648,4 @@
 	[killTask unAuthorize];
 }
 
-
 @end

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20070911/fa4e6103/attachment.html


More information about the macports-changes mailing list