cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agri...@apache.org
Subject ios commit: Remove commandDelegate property of CDVViewController.
Date Thu, 04 Oct 2012 03:18:42 GMT
Updated Branches:
  refs/heads/master fb9169bd5 -> 1a4156931


Remove commandDelegate property of CDVViewController.

It didn't make sense since the CDVViewController *is* the
commandDelegate.


Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/commit/1a415693
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/tree/1a415693
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/diff/1a415693

Branch: refs/heads/master
Commit: 1a4156931a3697c1b47fbfe806f5ba69b1655aa1
Parents: fb9169b
Author: Andrew Grieve <agrieve@chromium.org>
Authored: Wed Oct 3 23:09:37 2012 -0400
Committer: Andrew Grieve <agrieve@chromium.org>
Committed: Wed Oct 3 23:09:37 2012 -0400

----------------------------------------------------------------------
 CordovaLib/Classes/CDVViewController.h |    1 -
 CordovaLib/Classes/CDVViewController.m |   14 ++++++--------
 2 files changed, 6 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/1a415693/CordovaLib/Classes/CDVViewController.h
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVViewController.h b/CordovaLib/Classes/CDVViewController.h
index fed48aa..1734b84 100644
--- a/CordovaLib/Classes/CDVViewController.h
+++ b/CordovaLib/Classes/CDVViewController.h
@@ -41,7 +41,6 @@
 @property (nonatomic, readwrite, assign) BOOL useSplashScreen;
 @property (nonatomic, readonly, strong) IBOutlet UIActivityIndicatorView* activityView;
 @property (nonatomic, readonly, strong) UIImageView* imageView;
-@property (nonatomic, readwrite, strong) id <CDVCommandDelegate> commandDelegate;
 
 @property (nonatomic, readwrite, copy) NSString* wwwFolderName;
 @property (nonatomic, readwrite, copy) NSString* startPage;

http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/1a415693/CordovaLib/Classes/CDVViewController.m
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVViewController.m b/CordovaLib/Classes/CDVViewController.m
index 003059b..9a99906 100644
--- a/CordovaLib/Classes/CDVViewController.m
+++ b/CordovaLib/Classes/CDVViewController.m
@@ -42,7 +42,7 @@
 @synthesize webView, supportedOrientations;
 @synthesize pluginObjects, pluginsMap, whitelist;
 @synthesize settings, loadFromString;
-@synthesize imageView, activityView, useSplashScreen, commandDelegate;
+@synthesize imageView, activityView, useSplashScreen;
 @synthesize wwwFolderName, startPage, invokeString, initialized;
 
 - (void)__init
@@ -69,7 +69,6 @@
         self.supportedOrientations = [self parseInterfaceOrientations:
             [[[NSBundle mainBundle] infoDictionary] objectForKey:@"UISupportedInterfaceOrientations"]];
 
-        self.commandDelegate = self;
         self.wwwFolderName = @"www";
         self.startPage = @"index.html";
         [self setWantsFullScreenLayout:YES];
@@ -114,7 +113,6 @@
         }
     }
 
-    self.commandDelegate = nil;
     self.webView.delegate = nil;
     self.webView = nil;
 }
@@ -225,7 +223,7 @@
      */
 
     if ([enableLocation boolValue]) {
-        [[self.commandDelegate getCommandInstance:@"Geolocation"] getLocation:[CDVInvokedUrlCommand
new]];
+        [[self getCommandInstance:@"Geolocation"] getLocation:[CDVInvokedUrlCommand new]];
     }
 
     /*
@@ -233,7 +231,7 @@
      */
     if (!IsAtLeastiOSVersion(@"6.0")) {
         if (backupWebStorage) {
-            [self.commandDelegate registerPlugin:[[CDVLocalStorage alloc] initWithWebView:self.webView]
withClassName:NSStringFromClass([CDVLocalStorage class])];
+            [self registerPlugin:[[CDVLocalStorage alloc] initWithWebView:self.webView] withClassName:NSStringFromClass([CDVLocalStorage
class])];
         } else {
             [CDVLocalStorage __restoreThenRemoveBackupLocations];
         }
@@ -810,7 +808,7 @@ BOOL gSplashScreenShown = NO;
     // Iterate over and execute all of the commands.
     for (NSArray* jsonEntry in queuedCommands) {
         CDVInvokedUrlCommand* command = [CDVInvokedUrlCommand commandFromJson:jsonEntry];
-        if (![self.commandDelegate execute:command]) {
+        if (![self execute:command]) {
 #ifdef DEBUG
                 NSString* commandJson = [jsonEntry cdvjk_JSONString];
                 static NSUInteger maxLogLength = 1024;
@@ -868,7 +866,7 @@ BOOL gSplashScreenShown = NO;
     }
 
     // Fetch an instance of this class
-    CDVPlugin* obj = [self.commandDelegate getCommandInstance:command.className];
+    CDVPlugin* obj = [self getCommandInstance:command.className];
 
     if (!([obj isKindOfClass:[CDVPlugin class]])) { // still allow deprecated class, until
1.0 release
         NSLog(@"ERROR: Plugin '%@' not found, or is not a CDVPlugin. Check your plugin mapping
in Cordova.plist.", command.className);
@@ -907,7 +905,7 @@ BOOL gSplashScreenShown = NO;
     }
 
     if ([plugin respondsToSelector:@selector(setCommandDelegate:)]) {
-        [plugin setCommandDelegate:self.commandDelegate];
+        [plugin setCommandDelegate:self];
     }
 
     [self.pluginObjects setObject:plugin forKey:className];


Mime
View raw message