You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by sh...@apache.org on 2012/03/29 08:37:04 UTC
ios commit: Removed last remnants of PG prefix in the code,
with one deprecated method in CDVURLProtocol
Updated Branches:
refs/heads/master c8be1dc72 -> dd18bed47
Removed last remnants of PG prefix in the code, with one deprecated method in CDVURLProtocol
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/dd18bed4
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/tree/dd18bed4
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/diff/dd18bed4
Branch: refs/heads/master
Commit: dd18bed47c27f39bce3192fb6e3ad932bc4956ae
Parents: c8be1dc
Author: Shazron Abdullah <sh...@apache.org>
Authored: Wed Mar 28 23:36:39 2012 -0700
Committer: Shazron Abdullah <sh...@apache.org>
Committed: Wed Mar 28 23:36:39 2012 -0700
----------------------------------------------------------------------
CordovaLib/Classes/CDVCapture.m | 12 ++++++------
CordovaLib/Classes/CDVFile.m | 4 ++--
CordovaLib/Classes/CDVFileTransfer.m | 2 +-
CordovaLib/Classes/CDVLocation.m | 4 ++--
CordovaLib/Classes/CDVNotification.m | 4 ++--
CordovaLib/Classes/CDVURLProtocol.h | 3 ++-
CordovaLib/Classes/CDVURLProtocol.m | 6 +++++-
CordovaLib/Classes/CDVWhitelist.m | 4 ++--
8 files changed, 22 insertions(+), 17 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/dd18bed4/CordovaLib/Classes/CDVCapture.m
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVCapture.m b/CordovaLib/Classes/CDVCapture.m
index 05d1444..694aea2 100644
--- a/CordovaLib/Classes/CDVCapture.m
+++ b/CordovaLib/Classes/CDVCapture.m
@@ -140,7 +140,7 @@
pickerController.cameraDevice = UIImagePickerControllerCameraDeviceRear;
pickerController.cameraFlashMode = UIImagePickerControllerCameraFlashModeAuto;
}*/
- // PGImagePicker specific property
+ // CDVImagePicker specific property
pickerController.callbackId = callbackId;
pickerController.mimeType = mode;
@@ -260,7 +260,7 @@
//pickerController.cameraDevice = UIImagePickerControllerCameraDeviceRear;
//pickerController.cameraFlashMode = UIImagePickerControllerCameraFlashModeAuto;
}
- // PGImagePicker specific property
+ // CDVImagePicker specific property
pickerController.callbackId = callbackId;
if ([self.viewController respondsToSelector:@selector(presentViewController:::)]) {
@@ -364,8 +364,8 @@
id command = [self.commandDelegate getCommandInstance: @"File"];
bError = !([command isKindOfClass:[CDVFile class]]);
if (!bError) {
- CDVFile* pgFile = (CDVFile*)command;
- mimeType = [pgFile getMimeTypeFromPath:fullPath];
+ CDVFile* cdvFile = (CDVFile*)command;
+ mimeType = [cdvFile getMimeTypeFromPath:fullPath];
if (!mimeType) {
// can't do much without mimeType, return error
bError = YES;
@@ -450,8 +450,8 @@
if(!type) {
id command = [self.commandDelegate getCommandInstance: @"File"];
if([command isKindOfClass:[CDVFile class]]) {
- CDVFile* pgFile = (CDVFile*)command;
- NSString* mimeType = [pgFile getMimeTypeFromPath:fullPath];
+ CDVFile* cdvFile = (CDVFile*)command;
+ NSString* mimeType = [cdvFile getMimeTypeFromPath:fullPath];
[fileDict setObject: (mimeType != nil ? (NSObject*)mimeType : [NSNull null]) forKey:@"type"];
}
}
http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/dd18bed4/CordovaLib/Classes/CDVFile.m
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVFile.m b/CordovaLib/Classes/CDVFile.m
index b28d57f..6c8148e 100644
--- a/CordovaLib/Classes/CDVFile.m
+++ b/CordovaLib/Classes/CDVFile.m
@@ -840,13 +840,13 @@
NSString* strUri = [fullPath stringByReplacingPercentEscapesUsingEncoding: NSUTF8StringEncoding];
NSURL* fileUrl = [NSURL fileURLWithPath:strUri];
if (fileUrl) {
- result = [PluginResult resultWithStatus:PGCommandStatus_OK messageAsString: [fileUrl absoluteString]];
+ result = [PluginResult resultWithStatus:CDVCommandStatus_OK messageAsString: [fileUrl absoluteString]];
jsString = [result toSuccessCallbackString:callbackId];
} // else NOT_FOUND_ERR
}
if(!jsString) {
// was error
- result = [PluginResult resultWithStatus:PGCommandStatus_OK messageAsInt: NOT_FOUND_ERR cast: @"window.localFileSystem._castError"];
+ result = [PluginResult resultWithStatus:CDVCommandStatus_OK messageAsInt: NOT_FOUND_ERR cast: @"window.localFileSystem._castError"];
jsString = [result toErrorCallbackString:callbackId];
}
http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/dd18bed4/CordovaLib/Classes/CDVFileTransfer.m
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVFileTransfer.m b/CordovaLib/Classes/CDVFileTransfer.m
index 7e75592..97b510c 100644
--- a/CordovaLib/Classes/CDVFileTransfer.m
+++ b/CordovaLib/Classes/CDVFileTransfer.m
@@ -73,7 +73,7 @@
}
if(errorCode > 0) {
- //result = [PluginResult resultWithStatus: PGCommandStatus_OK messageAsInt: INVALID_URL_ERR cast: @"navigator.fileTransfer._castTransferError"];
+ //result = [PluginResult resultWithStatus: CDVCommandStatus_OK messageAsInt: INVALID_URL_ERR cast: @"navigator.fileTransfer._castTransferError"];
result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary: [self createFileTransferError:[NSString stringWithFormat:@"%d", errorCode] AndSource:filePath AndTarget:server]];
http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/dd18bed4/CordovaLib/Classes/CDVLocation.m
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVLocation.m b/CordovaLib/Classes/CDVLocation.m
index 665ea07..5129146 100755
--- a/CordovaLib/Classes/CDVLocation.m
+++ b/CordovaLib/Classes/CDVLocation.m
@@ -470,9 +470,9 @@
if ([self.locationManager respondsToSelector: @selector(headingOrientation)]) {
UIDeviceOrientation currentOrientation = [[UIDevice currentDevice] orientation];
if (currentOrientation != UIDeviceOrientationUnknown) {
- CDVViewController* pgViewController = (CDVViewController*)self.viewController;
+ CDVViewController* cdvViewController = (CDVViewController*)self.viewController;
- if ([pgViewController.supportedOrientations containsObject:
+ if ([cdvViewController.supportedOrientations containsObject:
[NSNumber numberWithInt:currentOrientation]]) {
self.locationManager.headingOrientation = (CLDeviceOrientation)currentOrientation;
http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/dd18bed4/CordovaLib/Classes/CDVNotification.m
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVNotification.m b/CordovaLib/Classes/CDVNotification.m
index ceef8a1..450bb49 100644
--- a/CordovaLib/Classes/CDVNotification.m
+++ b/CordovaLib/Classes/CDVNotification.m
@@ -90,9 +90,9 @@
{
//NSString *buttonLabel = [alertView buttonTitleAtIndex:buttonIndex];
- CDVAlertView* pgAlertView = (CDVAlertView*) alertView;
+ CDVAlertView* cdvAlertView = (CDVAlertView*) alertView;
CDVPluginResult* result = [CDVPluginResult resultWithStatus: CDVCommandStatus_OK messageAsInt: ++buttonIndex];
- [self writeJavascript:[result toSuccessCallbackString: [pgAlertView callbackId]]];
+ [self writeJavascript:[result toSuccessCallbackString: [cdvAlertView callbackId]]];
//NSString * jsCallBack = [NSString stringWithFormat:@"navigator.notification._alertCallback(%d,\"%@\");", ++buttonIndex, buttonLabel];
//[webView stringByEvaluatingJavaScriptFromString:jsCallBack];
}
http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/dd18bed4/CordovaLib/Classes/CDVURLProtocol.h
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVURLProtocol.h b/CordovaLib/Classes/CDVURLProtocol.h
index 527cd43..8940af5 100644
--- a/CordovaLib/Classes/CDVURLProtocol.h
+++ b/CordovaLib/Classes/CDVURLProtocol.h
@@ -22,7 +22,8 @@
@interface CDVURLProtocol : NSURLProtocol {
}
-+ (void) registerPGHttpURLProtocol;
++ (void) registerPGHttpURLProtocol __attribute__ ((deprecated("Renamed - use registerUrlProtocol instead.")));
++ (void) registerURLProtocol;
@end
http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/dd18bed4/CordovaLib/Classes/CDVURLProtocol.m
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVURLProtocol.m b/CordovaLib/Classes/CDVURLProtocol.m
index a15b54f..62d1f7f 100644
--- a/CordovaLib/Classes/CDVURLProtocol.m
+++ b/CordovaLib/Classes/CDVURLProtocol.m
@@ -25,8 +25,12 @@ static CDVWhitelist* gWhitelist = nil;
@implementation CDVURLProtocol
-// Called before any use of the protocol, ensure it is only called once
+ (void) registerPGHttpURLProtocol {
+ return [[self class] registerURLProtocol];
+}
+
+// Called before any use of the protocol, ensure it is only called once
++ (void) registerURLProtocol {
static BOOL registered = NO;
if (!registered) {
[NSURLProtocol registerClass:[CDVURLProtocol class]];
http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/dd18bed4/CordovaLib/Classes/CDVWhitelist.m
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVWhitelist.m b/CordovaLib/Classes/CDVWhitelist.m
index 3d9d714..14a33a4 100644
--- a/CordovaLib/Classes/CDVWhitelist.m
+++ b/CordovaLib/Classes/CDVWhitelist.m
@@ -84,7 +84,7 @@
- (void) processWhitelist
{
if (self.whitelist == nil) {
- NSLog(@"ERROR: PGWhitelist was not initialized properly, all urls will be disallowed.");
+ NSLog(@"ERROR: CDVWhitelist was not initialized properly, all urls will be disallowed.");
return;
}
@@ -144,7 +144,7 @@
- (BOOL) URLIsAllowed:(NSURL*)url
{
if (self.expandedWhitelist == nil) {
- NSLog(@"ERROR: PGWhitelist was not initialized properly, all urls will be disallowed.");
+ NSLog(@"ERROR: CDVWhitelist was not initialized properly, all urls will be disallowed.");
return NO;
}