Minor code improvement.
[FIXED] Some minor code fixes thanks to inspections. [FIXED] Some iOS6 deprecation issues. [IMPROVED] Cleanup with regards to store migration.
This commit is contained in:
parent
1b3f5f5d25
commit
725da285da
@ -5,7 +5,9 @@
|
|||||||
<inspection_tool class="FunctionImplicitDeclarationInspection" enabled="false" level="WARNING" enabled_by_default="false" />
|
<inspection_tool class="FunctionImplicitDeclarationInspection" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||||
<inspection_tool class="LossyEncoding" enabled="true" level="WARNING" enabled_by_default="true" />
|
<inspection_tool class="LossyEncoding" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||||
<inspection_tool class="MethodIsLaterInTheScope" enabled="false" level="WARNING" enabled_by_default="false" />
|
<inspection_tool class="MethodIsLaterInTheScope" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||||
|
<inspection_tool class="OCNotLocalizedStringInspection" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||||
<inspection_tool class="OCUnusedMethodInspection" enabled="false" level="WARNING" enabled_by_default="false" />
|
<inspection_tool class="OCUnusedMethodInspection" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||||
<inspection_tool class="UnusedLocalVariable" enabled="false" level="WARNING" enabled_by_default="false" />
|
<inspection_tool class="UnusedLocalVariable" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||||
|
<inspection_tool class="UnusedParameter" enabled="true" level="WEAK WARNING" enabled_by_default="true" />
|
||||||
</profile>
|
</profile>
|
||||||
</component>
|
</component>
|
2
External/Pearl
vendored
2
External/Pearl
vendored
@ -1 +1 @@
|
|||||||
Subproject commit 7cbc205dd8353c4b82ee6e8229df500cdaee0b94
|
Subproject commit b0271de7eb8fc9b6bb3e83fa8872b440171191d9
|
@ -5208,7 +5208,7 @@
|
|||||||
GCC_WARN_UNUSED_LABEL = YES;
|
GCC_WARN_UNUSED_LABEL = YES;
|
||||||
GCC_WARN_UNUSED_VALUE = YES;
|
GCC_WARN_UNUSED_VALUE = YES;
|
||||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||||
IPHONEOS_DEPLOYMENT_TARGET = 5.0;
|
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
|
||||||
ONLY_ACTIVE_ARCH = YES;
|
ONLY_ACTIVE_ARCH = YES;
|
||||||
OTHER_LDFLAGS = "-ObjC";
|
OTHER_LDFLAGS = "-ObjC";
|
||||||
PRODUCT_NAME = "${TARGET_NAME}";
|
PRODUCT_NAME = "${TARGET_NAME}";
|
||||||
@ -5271,7 +5271,7 @@
|
|||||||
GCC_WARN_UNUSED_LABEL = YES;
|
GCC_WARN_UNUSED_LABEL = YES;
|
||||||
GCC_WARN_UNUSED_VALUE = YES;
|
GCC_WARN_UNUSED_VALUE = YES;
|
||||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||||
IPHONEOS_DEPLOYMENT_TARGET = 5.0;
|
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
|
||||||
OTHER_LDFLAGS = "-ObjC";
|
OTHER_LDFLAGS = "-ObjC";
|
||||||
PRODUCT_NAME = "${TARGET_NAME}";
|
PRODUCT_NAME = "${TARGET_NAME}";
|
||||||
"PROVISIONING_PROFILE[sdk=iphoneos*]" = "";
|
"PROVISIONING_PROFILE[sdk=iphoneos*]" = "";
|
||||||
@ -5427,7 +5427,7 @@
|
|||||||
GCC_WARN_UNUSED_LABEL = YES;
|
GCC_WARN_UNUSED_LABEL = YES;
|
||||||
GCC_WARN_UNUSED_VALUE = YES;
|
GCC_WARN_UNUSED_VALUE = YES;
|
||||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||||
IPHONEOS_DEPLOYMENT_TARGET = 5.0;
|
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
|
||||||
OTHER_LDFLAGS = "-ObjC";
|
OTHER_LDFLAGS = "-ObjC";
|
||||||
PRODUCT_NAME = "${TARGET_NAME}";
|
PRODUCT_NAME = "${TARGET_NAME}";
|
||||||
"PROVISIONING_PROFILE[sdk=iphoneos*]" = "";
|
"PROVISIONING_PROFILE[sdk=iphoneos*]" = "";
|
||||||
|
@ -16,7 +16,6 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#import "MPAlgorithm.h"
|
#import "MPAlgorithm.h"
|
||||||
#import "MPEntities.h"
|
|
||||||
|
|
||||||
id<MPAlgorithm> MPAlgorithmForVersion(NSUInteger version) {
|
id<MPAlgorithm> MPAlgorithmForVersion(NSUInteger version) {
|
||||||
|
|
||||||
|
@ -42,13 +42,12 @@ static char managedObjectContextKey;
|
|||||||
|
|
||||||
- (void)migrateStoreForManager:(UbiquityStoreManager *)storeManager {
|
- (void)migrateStoreForManager:(UbiquityStoreManager *)storeManager {
|
||||||
|
|
||||||
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"iCloudEnabledKey"];
|
|
||||||
NSNumber *cloudEnabled = [[NSUserDefaults standardUserDefaults] objectForKey:@"iCloudEnabledKey"];
|
NSNumber *cloudEnabled = [[NSUserDefaults standardUserDefaults] objectForKey:@"iCloudEnabledKey"];
|
||||||
if (!cloudEnabled)
|
if (!cloudEnabled)
|
||||||
|
// No old data to migrate.
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if ([cloudEnabled boolValue]) {
|
if ([cloudEnabled boolValue]) {
|
||||||
NSURL *newCloudContentURL = [storeManager URLForCloudContent];
|
|
||||||
NSURL *newCloudStoreURL = [storeManager URLForCloudStore];
|
NSURL *newCloudStoreURL = [storeManager URLForCloudStore];
|
||||||
if ([[NSFileManager defaultManager] fileExistsAtPath:newCloudStoreURL.path isDirectory:NO])
|
if ([[NSFileManager defaultManager] fileExistsAtPath:newCloudStoreURL.path isDirectory:NO])
|
||||||
// New store already exists, migration has already been done.
|
// New store already exists, migration has already been done.
|
||||||
@ -56,6 +55,7 @@ static char managedObjectContextKey;
|
|||||||
|
|
||||||
NSString *uuid = [[NSUserDefaults standardUserDefaults] stringForKey:@"LocalUUIDKey"];
|
NSString *uuid = [[NSUserDefaults standardUserDefaults] stringForKey:@"LocalUUIDKey"];
|
||||||
NSURL *cloudContainerURL = [[NSFileManager defaultManager] URLForUbiquityContainerIdentifier:@"HL3Q45LX9N.com.lyndir.lhunath.MasterPassword.shared"];
|
NSURL *cloudContainerURL = [[NSFileManager defaultManager] URLForUbiquityContainerIdentifier:@"HL3Q45LX9N.com.lyndir.lhunath.MasterPassword.shared"];
|
||||||
|
NSURL *newCloudContentURL = [storeManager URLForCloudContent];
|
||||||
//NSURL *oldCloudContentURL = [[cloudContainerURL URLByAppendingPathComponent:@"Data" isDirectory:YES]
|
//NSURL *oldCloudContentURL = [[cloudContainerURL URLByAppendingPathComponent:@"Data" isDirectory:YES]
|
||||||
// URLByAppendingPathComponent:uuid isDirectory:YES];
|
// URLByAppendingPathComponent:uuid isDirectory:YES];
|
||||||
NSURL *oldCloudStoreDirectoryURL = [cloudContainerURL URLByAppendingPathComponent:@"Database.nosync" isDirectory:YES];
|
NSURL *oldCloudStoreDirectoryURL = [cloudContainerURL URLByAppendingPathComponent:@"Database.nosync" isDirectory:YES];
|
||||||
@ -136,6 +136,7 @@ static char managedObjectContextKey;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
[[NSUserDefaults standardUserDefaults] removeObjectForKey:@"LocalUUIDKey"];
|
||||||
[[NSUserDefaults standardUserDefaults] removeObjectForKey:@"iCloudEnabledKey"];
|
[[NSUserDefaults standardUserDefaults] removeObjectForKey:@"iCloudEnabledKey"];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,7 +6,6 @@
|
|||||||
// Copyright (c) 2012 Lyndir. All rights reserved.
|
// Copyright (c) 2012 Lyndir. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
#import "MPConfig.h"
|
|
||||||
#import "MPAppDelegate.h"
|
#import "MPAppDelegate.h"
|
||||||
|
|
||||||
@implementation MPConfig
|
@implementation MPConfig
|
||||||
|
@ -7,7 +7,6 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#import "MPElementEntity.h"
|
#import "MPElementEntity.h"
|
||||||
#import "MPUserEntity.h"
|
|
||||||
|
|
||||||
|
|
||||||
@implementation MPElementEntity
|
@implementation MPElementEntity
|
||||||
|
@ -15,7 +15,6 @@
|
|||||||
// Copyright 2012 lhunath (Maarten Billemont). All rights reserved.
|
// Copyright 2012 lhunath (Maarten Billemont). All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
#import "MPKey.h"
|
|
||||||
#import "MPAlgorithm.h"
|
#import "MPAlgorithm.h"
|
||||||
|
|
||||||
|
|
||||||
|
@ -7,7 +7,6 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#import "MPUserEntity.h"
|
#import "MPUserEntity.h"
|
||||||
#import "MPElementEntity.h"
|
|
||||||
|
|
||||||
|
|
||||||
@implementation MPUserEntity
|
@implementation MPUserEntity
|
||||||
|
@ -16,7 +16,6 @@
|
|||||||
#import "MPAppDelegate_Store.h"
|
#import "MPAppDelegate_Store.h"
|
||||||
|
|
||||||
#import "IASKSettingsReader.h"
|
#import "IASKSettingsReader.h"
|
||||||
#import "LocalyticsSession.h"
|
|
||||||
|
|
||||||
@interface MPAppDelegate ()
|
@interface MPAppDelegate ()
|
||||||
|
|
||||||
|
@ -16,7 +16,6 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#import "MPAppViewController.h"
|
#import "MPAppViewController.h"
|
||||||
#import "LocalyticsSession.h"
|
|
||||||
|
|
||||||
|
|
||||||
@implementation MPAppViewController {
|
@implementation MPAppViewController {
|
||||||
|
@ -16,7 +16,6 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#import "MPAppsViewController.h"
|
#import "MPAppsViewController.h"
|
||||||
#import "LocalyticsSession.h"
|
|
||||||
|
|
||||||
|
|
||||||
@interface MPAppsViewController ()
|
@interface MPAppsViewController ()
|
||||||
|
@ -7,12 +7,9 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#import "MPGuideViewController.h"
|
#import "MPGuideViewController.h"
|
||||||
#import "LocalyticsSession.h"
|
|
||||||
|
|
||||||
|
|
||||||
@implementation MPGuideViewController
|
@implementation MPGuideViewController
|
||||||
@synthesize scrollView;
|
|
||||||
@synthesize pageControl;
|
|
||||||
|
|
||||||
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
|
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
|
||||||
|
|
||||||
|
@ -10,7 +10,6 @@
|
|||||||
#import "MPAppDelegate.h"
|
#import "MPAppDelegate.h"
|
||||||
#import "MPAppDelegate_Key.h"
|
#import "MPAppDelegate_Key.h"
|
||||||
#import "MPAppDelegate_Store.h"
|
#import "MPAppDelegate_Store.h"
|
||||||
#import "LocalyticsSession.h"
|
|
||||||
|
|
||||||
|
|
||||||
@implementation MPMainViewController
|
@implementation MPMainViewController
|
||||||
|
@ -11,20 +11,12 @@
|
|||||||
#import "MPAppDelegate.h"
|
#import "MPAppDelegate.h"
|
||||||
#import "MPAppDelegate_Key.h"
|
#import "MPAppDelegate_Key.h"
|
||||||
#import "MPAppDelegate_Store.h"
|
#import "MPAppDelegate_Store.h"
|
||||||
#import "LocalyticsSession.h"
|
|
||||||
|
|
||||||
@interface MPPreferencesViewController ()
|
@interface MPPreferencesViewController ()
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation MPPreferencesViewController
|
@implementation MPPreferencesViewController
|
||||||
@synthesize avatarsView;
|
|
||||||
@synthesize avatarTemplate;
|
|
||||||
@synthesize savePasswordSwitch;
|
|
||||||
@synthesize exportCell;
|
|
||||||
@synthesize changeMPCell;
|
|
||||||
@synthesize defaultTypeLabel;
|
|
||||||
|
|
||||||
|
|
||||||
- (void)viewDidLoad {
|
- (void)viewDidLoad {
|
||||||
|
|
||||||
|
@ -8,7 +8,6 @@
|
|||||||
|
|
||||||
#import "MPSearchDelegate.h"
|
#import "MPSearchDelegate.h"
|
||||||
#import "MPAppDelegate.h"
|
#import "MPAppDelegate.h"
|
||||||
#import "LocalyticsSession.h"
|
|
||||||
#import "MPAppDelegate_Store.h"
|
#import "MPAppDelegate_Store.h"
|
||||||
|
|
||||||
@interface MPSearchDelegate (Private)
|
@interface MPSearchDelegate (Private)
|
||||||
@ -21,12 +20,6 @@
|
|||||||
|
|
||||||
NSFetchedResultsController *_fetchedResultsController;
|
NSFetchedResultsController *_fetchedResultsController;
|
||||||
}
|
}
|
||||||
@synthesize tipView;
|
|
||||||
@synthesize query;
|
|
||||||
@synthesize dateFormatter;
|
|
||||||
@synthesize delegate;
|
|
||||||
@synthesize searchDisplayController;
|
|
||||||
@synthesize searchTipContainer;
|
|
||||||
|
|
||||||
- (id)init {
|
- (id)init {
|
||||||
|
|
||||||
@ -38,7 +31,7 @@
|
|||||||
self.query = @"";
|
self.query = @"";
|
||||||
|
|
||||||
self.tipView = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 320, 170)];
|
self.tipView = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 320, 170)];
|
||||||
self.tipView.textAlignment = UITextAlignmentCenter;
|
self.tipView.textAlignment = NSTextAlignmentCenter;
|
||||||
self.tipView.backgroundColor = [UIColor clearColor];
|
self.tipView.backgroundColor = [UIColor clearColor];
|
||||||
self.tipView.textColor = [UIColor lightTextColor];
|
self.tipView.textColor = [UIColor lightTextColor];
|
||||||
self.tipView.shadowColor = [UIColor blackColor];
|
self.tipView.shadowColor = [UIColor blackColor];
|
||||||
|
@ -7,7 +7,6 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#import "MPTypeViewController.h"
|
#import "MPTypeViewController.h"
|
||||||
#import "LocalyticsSession.h"
|
|
||||||
|
|
||||||
|
|
||||||
@interface MPTypeViewController ()
|
@interface MPTypeViewController ()
|
||||||
@ -17,8 +16,6 @@
|
|||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation MPTypeViewController
|
@implementation MPTypeViewController
|
||||||
@synthesize delegate;
|
|
||||||
@synthesize recommendedTipContainer;
|
|
||||||
|
|
||||||
#pragma mark - View lifecycle
|
#pragma mark - View lifecycle
|
||||||
|
|
||||||
@ -72,8 +69,8 @@
|
|||||||
|
|
||||||
UITableViewCell *cell = [super tableView:tableView cellForRowAtIndexPath:indexPath];
|
UITableViewCell *cell = [super tableView:tableView cellForRowAtIndexPath:indexPath];
|
||||||
|
|
||||||
if ([delegate respondsToSelector:@selector(selectedType)])
|
if ([self.delegate respondsToSelector:@selector(selectedType)])
|
||||||
cell.selected = ([delegate selectedType] == [self typeAtIndexPath:indexPath]);
|
cell.selected = ([self.delegate selectedType] == [self typeAtIndexPath:indexPath]);
|
||||||
|
|
||||||
return cell;
|
return cell;
|
||||||
}
|
}
|
||||||
@ -87,7 +84,7 @@
|
|||||||
// Selected a non-type row.
|
// Selected a non-type row.
|
||||||
return;
|
return;
|
||||||
|
|
||||||
[delegate didSelectType:type];
|
[self.delegate didSelectType:type];
|
||||||
[self.navigationController popViewControllerAnimated:YES];
|
[self.navigationController popViewControllerAnimated:YES];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -98,7 +95,7 @@
|
|||||||
// Generated
|
// Generated
|
||||||
switch (indexPath.row) {
|
switch (indexPath.row) {
|
||||||
case 0:
|
case 0:
|
||||||
return NSNotFound;
|
return (MPElementType)NSNotFound;
|
||||||
case 1:
|
case 1:
|
||||||
return MPElementTypeGeneratedMaximum;
|
return MPElementTypeGeneratedMaximum;
|
||||||
case 2:
|
case 2:
|
||||||
@ -112,7 +109,7 @@
|
|||||||
case 6:
|
case 6:
|
||||||
return MPElementTypeGeneratedPIN;
|
return MPElementTypeGeneratedPIN;
|
||||||
case 7:
|
case 7:
|
||||||
return NSNotFound;
|
return (MPElementType)NSNotFound;
|
||||||
|
|
||||||
default: {
|
default: {
|
||||||
Throw(@"Unsupported row: %d, when selecting generated element type.", indexPath.row);
|
Throw(@"Unsupported row: %d, when selecting generated element type.", indexPath.row);
|
||||||
@ -124,13 +121,13 @@
|
|||||||
// Stored
|
// Stored
|
||||||
switch (indexPath.row) {
|
switch (indexPath.row) {
|
||||||
case 0:
|
case 0:
|
||||||
return NSNotFound;
|
return (MPElementType)NSNotFound;
|
||||||
case 1:
|
case 1:
|
||||||
return MPElementTypeStoredPersonal;
|
return MPElementTypeStoredPersonal;
|
||||||
case 2:
|
case 2:
|
||||||
return MPElementTypeStoredDevicePrivate;
|
return MPElementTypeStoredDevicePrivate;
|
||||||
case 3:
|
case 3:
|
||||||
return NSNotFound;
|
return (MPElementType)NSNotFound;
|
||||||
|
|
||||||
default: {
|
default: {
|
||||||
Throw(@"Unsupported row: %d, when selecting stored element type.", indexPath.row);
|
Throw(@"Unsupported row: %d, when selecting stored element type.", indexPath.row);
|
||||||
|
@ -19,7 +19,6 @@
|
|||||||
#import "MPAppDelegate.h"
|
#import "MPAppDelegate.h"
|
||||||
#import "MPAppDelegate_Key.h"
|
#import "MPAppDelegate_Key.h"
|
||||||
#import "MPAppDelegate_Store.h"
|
#import "MPAppDelegate_Store.h"
|
||||||
#import "LocalyticsSession.h"
|
|
||||||
|
|
||||||
@interface MPUnlockViewController ()
|
@interface MPUnlockViewController ()
|
||||||
|
|
||||||
@ -29,32 +28,9 @@
|
|||||||
@property (nonatomic, strong) NSArray *wordList;
|
@property (nonatomic, strong) NSArray *wordList;
|
||||||
@property (nonatomic, strong) NSOperationQueue *fbOperationQueue;
|
@property (nonatomic, strong) NSOperationQueue *fbOperationQueue;
|
||||||
|
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation MPUnlockViewController
|
@implementation MPUnlockViewController
|
||||||
@synthesize selectedUser;
|
|
||||||
@synthesize avatarToUser;
|
|
||||||
@synthesize spinner;
|
|
||||||
@synthesize passwordFieldLabel;
|
|
||||||
@synthesize passwordField;
|
|
||||||
@synthesize passwordView;
|
|
||||||
@synthesize avatarsView;
|
|
||||||
@synthesize nameLabel, oldNameLabel;
|
|
||||||
@synthesize avatarTemplate;
|
|
||||||
@synthesize createPasswordTipView;
|
|
||||||
@synthesize tip;
|
|
||||||
@synthesize passwordTipView;
|
|
||||||
@synthesize passwordTipLabel;
|
|
||||||
@synthesize wordWall;
|
|
||||||
@synthesize targetedUserActionGesture;
|
|
||||||
@synthesize loadingUsersIndicator;
|
|
||||||
@synthesize uiContainer;
|
|
||||||
@synthesize avatarShadowColor = _avatarShadowColor;
|
|
||||||
@synthesize wordWallAnimating = _wordWallAnimating;
|
|
||||||
@synthesize wordList = _wordList;
|
|
||||||
@synthesize fbOperationQueue = _fbOperationQueue;
|
|
||||||
|
|
||||||
|
|
||||||
- (void)initializeAvatarAlert:(UIAlertView *)alert forUser:(MPUserEntity *)user {
|
- (void)initializeAvatarAlert:(UIAlertView *)alert forUser:(MPUserEntity *)user {
|
||||||
|
|
||||||
@ -351,7 +327,7 @@
|
|||||||
}
|
}
|
||||||
if (![alert textFieldAtIndex:0].text.length) {
|
if (![alert textFieldAtIndex:0].text.length) {
|
||||||
[PearlAlert showAlertWithTitle:@"Name Is Required" message:nil viewStyle:UIAlertViewStyleDefault initAlert:nil
|
[PearlAlert showAlertWithTitle:@"Name Is Required" message:nil viewStyle:UIAlertViewStyleDefault initAlert:nil
|
||||||
tappedButtonBlock:^(UIAlertView *alert, NSInteger buttonIndex) {
|
tappedButtonBlock:^(UIAlertView *alert_, NSInteger buttonIndex_) {
|
||||||
[self showNewUserNameAlertFor:newUser completion:completion];
|
[self showNewUserNameAlertFor:newUser completion:completion];
|
||||||
} cancelTitle:@"Try Again" otherTitles:nil];
|
} cancelTitle:@"Try Again" otherTitles:nil];
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user