[52228] branches/gsoc09-gui/MacPorts_Framework

juanger at macports.org juanger at macports.org
Fri Jun 12 11:49:18 PDT 2009


Revision: 52228
          http://trac.macports.org/changeset/52228
Author:   juanger at macports.org
Date:     2009-06-12 11:49:15 -0700 (Fri, 12 Jun 2009)
Log Message:
-----------
Making PKGPath a class variable in MPMacPorts to use diferent MacPorts installations.

Modified Paths:
--------------
    branches/gsoc09-gui/MacPorts_Framework/MPMacPorts.h
    branches/gsoc09-gui/MacPorts_Framework/MPMacPorts.m

Modified: branches/gsoc09-gui/MacPorts_Framework/MPMacPorts.h
===================================================================
--- branches/gsoc09-gui/MacPorts_Framework/MPMacPorts.h	2009-06-12 17:52:31 UTC (rev 52227)
+++ branches/gsoc09-gui/MacPorts_Framework/MPMacPorts.h	2009-06-12 18:49:15 UTC (rev 52228)
@@ -76,6 +76,9 @@
 	
 }
 
++ (void) initialize;
++ (void) setPKGPath:(NSString *) path;
+
 /*!
  @brief Returns an MPMacPorts object that represents the MacPorts system on user's machine.
  */

Modified: branches/gsoc09-gui/MacPorts_Framework/MPMacPorts.m
===================================================================
--- branches/gsoc09-gui/MacPorts_Framework/MPMacPorts.m	2009-06-12 17:52:31 UTC (rev 52227)
+++ branches/gsoc09-gui/MacPorts_Framework/MPMacPorts.m	2009-06-12 18:49:15 UTC (rev 52228)
@@ -36,10 +36,18 @@
 #import "MPMacPorts.h"
 #import "MPNotifications.h"
 
+static NSString* PKGPath;
 
 @implementation MPMacPorts
 
++ (void) initialize {
+	PKGPath = MP_DEFAULT_PKG_PATH;
+}
 
++ (void) setPKGPath: (NSString*) path {
+	PKGPath = path;
+}
+
 - (id) init {
 	return [self initWithPkgPath:MP_DEFAULT_PKG_PATH portOptions:nil];
 }
@@ -54,11 +62,11 @@
 }
 
 + (MPMacPorts *)sharedInstance {
-	return [self sharedInstanceWithPkgPath:MP_DEFAULT_PKG_PATH];
+	return [self sharedInstanceWithPkgPath:PKGPath];
 }
 
 + (MPMacPorts *)sharedInstanceWithPortOptions:(NSArray *)options {
-	return [self sharedInstanceWithPkgPath:MP_DEFAULT_PKG_PATH portOptions:options];
+	return [self sharedInstanceWithPkgPath:PKGPath portOptions:options];
 }
 
 + (MPMacPorts *)sharedInstanceWithPkgPath:(NSString *)path portOptions:(NSArray *)options {
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090612/f618c183/attachment.html>


More information about the macports-changes mailing list