Converted project to ARC

This commit is contained in:
michael starke
2013-07-03 23:40:20 +02:00
parent f3a67bfea2
commit df98a9b649
52 changed files with 224 additions and 355 deletions

View File

@@ -47,9 +47,8 @@
group.image = 37;
[parentGroup addGroup:group];
[rootGroup release];
return [tree autorelease];
return tree;
}
@end

View File

@@ -71,7 +71,7 @@
group.image = 37;
[parentGroup addGroup:group];
return [tree autorelease];
return tree;
}
@end

View File

@@ -14,7 +14,7 @@
static NSDictionary *actionDict;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
actionDict = [@{
actionDict = @{
@(MPActionAddEntry) : @"createEntry:",
@(MPActionAddGroup) : @"createGroup:",
@(MPActionCopyPassword) : @"copyPassword:",
@@ -26,7 +26,7 @@
@(MPActionToggleInspector) : @"toggleInspector:",
@(MPActionLock) : @"lock:",
@(MPActionEmptyTrash) : @"emptyTrash:"
} retain];
};
});
return NSSelectorFromString(actionDict[@(type)]);
}

View File

@@ -10,7 +10,7 @@
@interface MPAppDelegate : NSObject <NSApplicationDelegate>
@property (retain) IBOutlet NSWindow *passwordCreatorWindow;
@property (strong) IBOutlet NSWindow *passwordCreatorWindow;
- (IBAction)showPasswordCreator:(id)sender;

View File

@@ -23,8 +23,8 @@
MPLockDaemon *lockDaemon;
}
@property (retain, nonatomic) MPSettingsWindowController *settingsController;
@property (retain, nonatomic) MPPasswordCreatorViewController *passwordCreatorController;
@property (strong, nonatomic) MPSettingsWindowController *settingsController;
@property (strong, nonatomic) MPPasswordCreatorViewController *passwordCreatorController;
- (IBAction)showPreferences:(id)sender;
@@ -47,14 +47,6 @@
lockDaemon = [[MPLockDaemon alloc] init];
}
- (void)dealloc {
[_settingsController release];
[_passwordCreatorController release];
[_passwordCreatorWindow release];
[serverDaemon release];
[lockDaemon release];
[super dealloc];
}
- (NSString *)applicationName {
return [[NSBundle mainBundle] infoDictionary][@"CFBundleName"];
@@ -63,7 +55,7 @@
#pragma mark Menu Actions
- (void)showPreferences:(id)sender {
if(self.settingsController == nil) {
self.settingsController = [[[MPSettingsWindowController alloc] init] autorelease];
self.settingsController = [[MPSettingsWindowController alloc] init];
}
[self.settingsController showSettings];
}
@@ -73,7 +65,7 @@
[[NSBundle mainBundle] loadNibNamed:@"PasswordCreatorWindow"owner:self topLevelObjects:nil];
}
if(!self.passwordCreatorController) {
self.passwordCreatorController = [[[MPPasswordCreatorViewController alloc] init] autorelease];
self.passwordCreatorController = [[MPPasswordCreatorViewController alloc] init];
NSView *creatorView = [_passwordCreatorController view];
//NSView *contentView = [_passwordCreatorWindow contentView];
[self.passwordCreatorWindow setContentView:creatorView];

View File

@@ -28,8 +28,6 @@
keyEquivalent:@"E"];
[items addObjectsFromArray:@[ newGroup, newEntry ]];
[newEntry release];
[newGroup release];
}
if(insertDelete || insertTrash) {
[self _beginSection:items];
@@ -38,7 +36,6 @@
action:[MPActionHelper actionOfType:MPActionDelete]
keyEquivalent:@""];
[items addObject:delete];
[delete release];
}
if(insertTrash) {
@@ -49,7 +46,6 @@
unichar backSpace = NSBackspaceCharacter;
[emptyTrash setKeyEquivalent:[NSString stringWithCharacters:&backSpace length:1]];
[items addObject:emptyTrash];
[emptyTrash release];
}
}
@@ -67,7 +63,6 @@
action:0
keyEquivalent:@""];
[urlItem setSubmenu:urlMenu];
[urlMenu release];
NSMenuItem *copyURL = [[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"COPY_URL", @"")
action:[MPActionHelper actionOfType:MPActionCopyURL]
@@ -77,13 +72,8 @@
keyEquivalent:@"U"];
[urlMenu addItem:copyURL];
[urlMenu addItem:openURL];
[openURL release];
[copyURL release];
[items addObjectsFromArray:@[ copyUsername, copyPassword, urlItem]];
[urlItem release];
[copyPassword release];
[copyUsername release];
}
return items;

View File

@@ -10,8 +10,8 @@
@interface MPCustomFieldTableCellView : NSTableCellView
@property (assign) IBOutlet NSTextField *labelTextField;
@property (assign) IBOutlet NSTextField *valueTextField;
@property (assign) IBOutlet NSButton *removeButton;
@property (weak) IBOutlet NSTextField *labelTextField;
@property (weak) IBOutlet NSTextField *valueTextField;
@property (weak) IBOutlet NSButton *removeButton;
@end

View File

@@ -10,8 +10,8 @@
@interface MPCustomFieldView : NSView
@property (assign) IBOutlet NSTextField *labelTextField;
@property (assign) IBOutlet NSTextField *valueTextField;
@property (assign) IBOutlet NSButton *deleteButton;
@property (weak) IBOutlet NSTextField *labelTextField;
@property (weak) IBOutlet NSTextField *valueTextField;
@property (weak) IBOutlet NSButton *deleteButton;
@end

View File

@@ -39,11 +39,11 @@ APPKIT_EXTERN NSString *const MPDocumentGroupKey;
@property (assign, getter = isLocked) BOOL locked;
/* true, if document is loaded and decrypted (tree is loaded) */
@property (assign, readonly, getter = isDecrypted) BOOL decrypted;
@property (retain, readonly, nonatomic) KdbTree *tree;
@property (assign, readonly, nonatomic) KdbGroup *root;
@property (readonly, retain) MPRootAdapter *rootAdapter;
@property (nonatomic, retain) NSString *password;
@property (nonatomic, retain) NSURL *key;
@property (strong, readonly, nonatomic) KdbTree *tree;
@property (weak, readonly, nonatomic) KdbGroup *root;
@property (readonly, strong) MPRootAdapter *rootAdapter;
@property (nonatomic, strong) NSString *password;
@property (nonatomic, strong) NSURL *key;
@property (assign, readonly) MPDatabaseVersion version;
@property (assign, readonly, getter = isReadOnly) BOOL readOnly;

View File

@@ -43,19 +43,19 @@ NSString *const MPDocumentGroupKey = @"MPDocumentGroupKey";
}
@property (retain, nonatomic) KdbTree *tree;
@property (assign, nonatomic) KdbGroup *root;
@property (nonatomic, readonly) KdbPassword *passwordHash;
@property (strong, nonatomic) KdbTree *tree;
@property (weak, nonatomic) KdbGroup *root;
@property (weak, nonatomic, readonly) KdbPassword *passwordHash;
@property (assign) MPDatabaseVersion version;
@property (assign, nonatomic) BOOL secured;
@property (assign) BOOL decrypted;
@property (assign) BOOL readOnly;
@property (retain) NSURL *lockFileURL;
@property (strong) NSURL *lockFileURL;
@property (readonly) BOOL useTrash;
@property (readonly) KdbGroup *trash;
@property (weak, readonly) KdbGroup *trash;
@end
@@ -85,7 +85,7 @@ NSString *const MPDocumentGroupKey = @"MPDocumentGroupKey";
self.tree = [Kdb4Tree templateTree];
break;
default:
[self release];
self = nil;
return nil;
}
}
@@ -94,18 +94,11 @@ NSString *const MPDocumentGroupKey = @"MPDocumentGroupKey";
- (void)dealloc {
[self _cleanupLock];
[_tree release];
[_password release];
[_key release];
[_lockFileURL release];
[_rootAdapter release];
[super dealloc];
}
- (void)makeWindowControllers {
MPDocumentWindowController *windowController = [[MPDocumentWindowController alloc] init];
[self addWindowController:windowController];
[windowController release];
}
- (void)windowControllerDidLoadNib:(NSWindowController *)aController
@@ -179,23 +172,21 @@ NSString *const MPDocumentGroupKey = @"MPDocumentGroupKey";
- (void)setPassword:(NSString *)password {
if(![_password isEqualToString:password]) {
[_password release];
_password = [password retain];
_password = password;
_secured |= ([_password length] > 0);
}
}
- (void)setKey:(NSURL *)key {
if(![[_key absoluteString] isEqualToString:[key absoluteString]]) {
[_key release];
_key = [key retain];
_key = key;
_secured |= (_key != nil);
}
}
- (KdbPassword *)passwordHash {
return [[[KdbPassword alloc] initWithPassword:self.password passwordEncoding:NSUTF8StringEncoding keyFileURL:self.key] autorelease];
return [[KdbPassword alloc] initWithPassword:self.password passwordEncoding:NSUTF8StringEncoding keyFileURL:self.key];
}
+ (BOOL)autosavesInPlace
@@ -206,8 +197,7 @@ NSString *const MPDocumentGroupKey = @"MPDocumentGroupKey";
#pragma mark Data Accesors
- (void)setTree:(KdbTree *)tree {
if(_tree != tree) {
[_tree release];
_tree = [tree retain];
_tree = tree;
self.rootAdapter.tree = _tree;
}
}

View File

@@ -41,11 +41,6 @@
return self;
}
- (void)dealloc
{
[rootUuid release];
[super dealloc];
}
- (KdbEntry *)configurationEntry {
/*

View File

@@ -13,28 +13,28 @@
@interface MPDocumentSettingsWindowController : NSWindowController
@property (assign) IBOutlet NSTabView *sectionTabView;
@property (weak) IBOutlet NSTabView *sectionTabView;
/* General Tab */
@property (assign) IBOutlet NSTextField *databaseNameTextField;
@property (assign) IBOutlet NSTextView *databaseDescriptionTextView;
@property (weak) IBOutlet NSTextField *databaseNameTextField;
@property (unsafe_unretained) IBOutlet NSTextView *databaseDescriptionTextView;
/* Protection */
@property (assign) IBOutlet NSTextField *passwordTextField;
@property (assign) IBOutlet NSPathControl *keyfilePathControl;
@property (weak) IBOutlet NSTextField *passwordTextField;
@property (weak) IBOutlet NSPathControl *keyfilePathControl;
/* Display Tab */
@property (assign) IBOutlet NSButton *protectTitleCheckButton;
@property (assign) IBOutlet NSButton *protectUserNameCheckButton;
@property (assign) IBOutlet NSButton *protectPasswortCheckButton;
@property (assign) IBOutlet NSButton *protectURLCheckButton;
@property (assign) IBOutlet NSButton *protectNotesCheckButton;
@property (weak) IBOutlet NSButton *protectTitleCheckButton;
@property (weak) IBOutlet NSButton *protectUserNameCheckButton;
@property (weak) IBOutlet NSButton *protectPasswortCheckButton;
@property (weak) IBOutlet NSButton *protectURLCheckButton;
@property (weak) IBOutlet NSButton *protectNotesCheckButton;
/* Advanced Tab*/
@property (assign) IBOutlet NSButton *enableRecycleBinCheckButton;
@property (assign) IBOutlet NSButton *emptyRecycleBinOnQuitCheckButton;
@property (assign) IBOutlet NSPopUpButton *selectRecycleBinGroupPopUpButton;
@property (weak) IBOutlet NSButton *enableRecycleBinCheckButton;
@property (weak) IBOutlet NSButton *emptyRecycleBinOnQuitCheckButton;
@property (weak) IBOutlet NSPopUpButton *selectRecycleBinGroupPopUpButton;
- (id)initWithDocument:(MPDocument *)document;
- (void)update;

View File

@@ -117,14 +117,12 @@
[groupItem setState:NSOnState];
}
[menu addItem:groupItem];
[groupItem release];
}
NSMenuItem *selectItem = [[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"SELECT_RECYCLEBIN", @"Menu item if no reycleBin is selected") action:NULL keyEquivalent:@""];
[selectItem setAction:@selector(_didSelectTrashFolder:)];
[selectItem setTarget:self];
[menu insertItem:selectItem atIndex:0];
[selectItem release];
return [menu autorelease];
return menu;
}
@end

View File

@@ -22,17 +22,17 @@ APPKIT_EXTERN NSString *const MPCurrentItemChangedNotification;
@interface MPDocumentWindowController : NSWindowController <NSWindowDelegate>
@property (readonly, retain) MPPasswordInputController *passwordInputController;
@property (readonly, retain) MPPasswordEditViewController *passwordEditController;
@property (readonly, retain) MPEntryViewController *entryViewController;
@property (readonly, retain) MPOutlineViewController *outlineViewController;
@property (readonly, retain) MPInspectorViewController *inspectorViewController;
@property (readonly, strong) MPPasswordInputController *passwordInputController;
@property (readonly, strong) MPPasswordEditViewController *passwordEditController;
@property (readonly, strong) MPEntryViewController *entryViewController;
@property (readonly, strong) MPOutlineViewController *outlineViewController;
@property (readonly, strong) MPInspectorViewController *inspectorViewController;
/* Holds the current item. That is either a KdbGroup or a KdbEntry */
@property (readonly, assign) id currentItem;
@property (readonly, assign) KdbGroup *currentGroup;
@property (readonly, assign) KdbEntry *currentEntry;
@property (readonly, unsafe_unretained) id currentItem;
@property (readonly, unsafe_unretained) KdbGroup *currentGroup;
@property (readonly, unsafe_unretained) KdbEntry *currentEntry;
- (void)showEntries;

View File

@@ -26,21 +26,21 @@ NSString *const MPCurrentItemChangedNotification = @"com.hicknhack.macpass.MPCur
id _firstResponder;
}
@property (retain) IBOutlet NSSplitView *splitView;
@property (strong) IBOutlet NSSplitView *splitView;
@property (retain) NSToolbar *toolbar;
@property (assign) id currentItem;
@property (assign) KdbGroup *currentGroup;
@property (assign) KdbEntry *currentEntry;
@property (strong) NSToolbar *toolbar;
@property (unsafe_unretained) id currentItem;
@property (unsafe_unretained) KdbGroup *currentGroup;
@property (unsafe_unretained) KdbEntry *currentEntry;
@property (retain) MPPasswordInputController *passwordInputController;
@property (retain) MPPasswordEditViewController *passwordEditController;
@property (retain) MPEntryViewController *entryViewController;
@property (retain) MPOutlineViewController *outlineViewController;
@property (retain) MPInspectorViewController *inspectorViewController;
@property (retain) MPDocumentSettingsWindowController *documentSettingsWindowController;
@property (strong) MPPasswordInputController *passwordInputController;
@property (strong) MPPasswordEditViewController *passwordEditController;
@property (strong) MPEntryViewController *entryViewController;
@property (strong) MPOutlineViewController *outlineViewController;
@property (strong) MPInspectorViewController *inspectorViewController;
@property (strong) MPDocumentSettingsWindowController *documentSettingsWindowController;
@property (retain) MPToolbarDelegate *toolbarDelegate;
@property (strong) MPToolbarDelegate *toolbarDelegate;
@end
@@ -66,17 +66,8 @@ NSString *const MPCurrentItemChangedNotification = @"com.hicknhack.macpass.MPCur
- (void)dealloc {
[[NSNotificationCenter defaultCenter] removeObserver:self];
[_toolbar release];
[_passwordInputController release];
[_passwordEditController release];
[_entryViewController release];
[_outlineViewController release];
[_inspectorViewController release];
[_toolbarDelegate release];
[_splitView release];
[super dealloc];
}
#pragma mark View Handling
@@ -207,7 +198,7 @@ NSString *const MPCurrentItemChangedNotification = @"com.hicknhack.macpass.MPCur
- (void)showPasswordInput {
if(!self.passwordInputController) {
self.passwordInputController = [[[MPPasswordInputController alloc] init] autorelease];
self.passwordInputController = [[MPPasswordInputController alloc] init];
}
[self _setContentViewController:self.passwordInputController];
[self.passwordInputController requestPassword];

View File

@@ -11,6 +11,6 @@
@class MPEntryViewController;
@interface MPEntryTableDataSource : NSObject <NSTableViewDataSource>
@property (assign, nonatomic) MPEntryViewController *viewController;
@property (weak, nonatomic) MPEntryViewController *viewController;
@end

View File

@@ -32,7 +32,6 @@
NSPasteboardItem *pBoardItem = [[NSPasteboardItem alloc] init];
[pBoardItem setString:[uuid description] forType:MPPasteBoardType];
[pboard writeObjects:@[pBoardItem]];
[pBoardItem release];
return YES;
}

View File

@@ -31,11 +31,11 @@ typedef NS_ENUM( NSUInteger, MPCopyContentTypeTag) {
@interface MPEntryViewController : MPViewController <NSTableViewDelegate>
@property (readonly, assign, nonatomic) KdbEntry *selectedEntry;
@property (readonly, weak, nonatomic) KdbEntry *selectedEntry;
@property (assign,readonly) NSTableView *entryTable;
@property (readonly, retain) NSArrayController *entryArrayController;
@property (nonatomic, retain) NSString *filter;
@property (weak,readonly) NSTableView *entryTable;
@property (readonly, strong) NSArrayController *entryArrayController;
@property (nonatomic, strong) NSString *filter;
/* Call this after alle viewcontroller are loaded */

View File

@@ -61,27 +61,27 @@ NSString *const _toggleFilterUsernameButton = @"SearchUsername";
@interface MPEntryViewController ()
@property (retain) NSArrayController *entryArrayController;
@property (retain) NSArray *filteredEntries;
@property (retain) IBOutlet NSView *filterBar;
@property (assign) IBOutlet NSTableView *entryTable;
@property (retain) IBOutlet NSLayoutConstraint *tableToTop;
@property (assign) IBOutlet NSButton *filterDoneButton;
@property (strong) NSArrayController *entryArrayController;
@property (strong) NSArray *filteredEntries;
@property (strong) IBOutlet NSView *filterBar;
@property (weak) IBOutlet NSTableView *entryTable;
@property (strong) IBOutlet NSLayoutConstraint *tableToTop;
@property (weak) IBOutlet NSButton *filterDoneButton;
@property (assign) IBOutlet NSButton *filterTitleButton;
@property (assign) IBOutlet NSButton *filterUsernameButton;
@property (assign) IBOutlet NSButton *filterURLButton;
@property (assign) IBOutlet NSTextField *filterLabelTextField;
@property (assign) IBOutlet NSSearchField *filterSearchField;
@property (assign) IBOutlet HNHGradientView *bottomBar;
@property (assign) IBOutlet NSButton *addEntryButton;
@property (weak) IBOutlet NSButton *filterTitleButton;
@property (weak) IBOutlet NSButton *filterUsernameButton;
@property (weak) IBOutlet NSButton *filterURLButton;
@property (weak) IBOutlet NSTextField *filterLabelTextField;
@property (weak) IBOutlet NSSearchField *filterSearchField;
@property (weak) IBOutlet HNHGradientView *bottomBar;
@property (weak) IBOutlet NSButton *addEntryButton;
@property (assign) KdbEntry *selectedEntry;
@property (weak) KdbEntry *selectedEntry;
@property (nonatomic, retain) MPEntryTableDataSource *dataSource;
@property (nonatomic, strong) MPEntryTableDataSource *dataSource;
@property (assign, nonatomic) MPFilterModeType filterMode;
@property (retain, nonatomic) NSDictionary *filterButtonToMode;
@property (strong, nonatomic) NSDictionary *filterButtonToMode;
@end
@@ -96,10 +96,10 @@ NSString *const _toggleFilterUsernameButton = @"SearchUsername";
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if(self) {
_filterMode = MPFilterTitles;
_filterButtonToMode = [@{ _toggleFilterUsernameButton : @(MPFilterUsernames),
_filterButtonToMode = @{ _toggleFilterUsernameButton : @(MPFilterUsernames),
_toggleFilterTitleButton : @(MPFilterTitles),
_toggleFilterURLButton : @(MPFilterUrls)
} retain];
};
_entryArrayController = [[NSArrayController alloc] init];
_dataSource = [[MPEntryTableDataSource alloc] init];
_dataSource.viewController = self;
@@ -111,14 +111,6 @@ NSString *const _toggleFilterUsernameButton = @"SearchUsername";
- (void)dealloc {
[[NSNotificationCenter defaultCenter] removeObserver:self];
[_entryArrayController release];
[_filteredEntries release];
[_filter release];
[_filterBar release];
[_tableToTop release];
[_dataSource release];
[_filterButtonToMode release];
[super dealloc];
}
- (void)didLoadView {
@@ -273,8 +265,7 @@ NSString *const _toggleFilterUsernameButton = @"SearchUsername";
- (void)setFilter:(NSString *)filter {
if(_filter != filter) {
[_filter release];
_filter = [filter retain];
_filter = filter;
[self updateFilter];
}
}
@@ -437,7 +428,6 @@ NSString *const _toggleFilterUsernameButton = @"SearchUsername";
[menu addItem:item];
}
[self.entryTable setMenu:menu];
[menu release];
}
#pragma makr Action Helper

View File

@@ -12,9 +12,9 @@
@interface MPGeneralSettingsController : MPViewController <MPSettingsTab>
@property (assign) IBOutlet NSButton *clearPasteboardOnQuitCheckButton;
@property (assign) IBOutlet NSPopUpButton *clearPasteboardTimeoutPopup;
@property (assign) IBOutlet NSPopUpButton *idleTimeOutPopup;
@property (assign) IBOutlet NSButton *lockOnSleepCheckButton;
@property (weak) IBOutlet NSButton *clearPasteboardOnQuitCheckButton;
@property (weak) IBOutlet NSPopUpButton *clearPasteboardTimeoutPopup;
@property (weak) IBOutlet NSPopUpButton *idleTimeOutPopup;
@property (weak) IBOutlet NSButton *lockOnSleepCheckButton;
@end

View File

@@ -26,7 +26,7 @@
MPIconType iconType = (MPIconType)[iconNumber integerValue];
[icons addObject:[MPIconHelper icon:iconType]];
}
return [icons autorelease];
return icons;
}
+ (NSDictionary *)availableIconNames {

View File

@@ -10,7 +10,7 @@
@interface MPIconSelectViewController : MPViewController <NSCollectionViewDelegate>
@property (assign) IBOutlet NSCollectionView *iconCollectionView;
@property (weak) IBOutlet NSCollectionView *iconCollectionView;
- (IBAction)useDefault:(id)sender;
@end

View File

@@ -36,10 +36,5 @@
}
- (IBAction)useDefault:(id)sender {
SEL hidePopup = @selector(hideImagePopup:);
id target = [[NSApplication sharedApplication] targetForAction:hidePopup to:nil from:self];
if( target ) {
[target performSelector:hidePopup withObject:self];
}
}
@end

View File

@@ -16,22 +16,22 @@
@interface MPInspectorViewController : MPViewController <NSPopoverDelegate, NSTableViewDelegate>
@property (assign) IBOutlet MPPopupImageView *itemImageView;
@property (assign) IBOutlet NSTextField *itemNameTextfield;
@property (weak) IBOutlet MPPopupImageView *itemImageView;
@property (weak) IBOutlet NSTextField *itemNameTextfield;
@property (assign) IBOutlet NSTextField *titleTextField;
@property (assign) IBOutlet NSTextField *usernameTextField;
@property (assign) IBOutlet NSTextField *URLTextField;
@property (assign) IBOutlet NSTextField *passwordTextField;
@property (assign) IBOutlet NSTextField *titleOrNameLabel;
@property (assign) IBOutlet HNHGradientView *bottomBar;
@property (assign) IBOutlet NSTextField *createdTextField;
@property (assign) IBOutlet NSTextField *modifiedTextField;
@property (assign) IBOutlet NSSegmentedControl *infoTabControl;
@property (assign) IBOutlet NSTableView *attachmentTableView;
@property (assign) IBOutlet NSTableView *customFieldsTableView;
@property (assign) IBOutlet NSTextView *notesTextView;
@property (assign) IBOutlet NSTextField *customFieldsTextField;
@property (weak) IBOutlet NSTextField *titleTextField;
@property (weak) IBOutlet NSTextField *usernameTextField;
@property (weak) IBOutlet NSTextField *URLTextField;
@property (weak) IBOutlet NSTextField *passwordTextField;
@property (weak) IBOutlet NSTextField *titleOrNameLabel;
@property (weak) IBOutlet HNHGradientView *bottomBar;
@property (weak) IBOutlet NSTextField *createdTextField;
@property (weak) IBOutlet NSTextField *modifiedTextField;
@property (weak) IBOutlet NSSegmentedControl *infoTabControl;
@property (weak) IBOutlet NSTableView *attachmentTableView;
@property (weak) IBOutlet NSTableView *customFieldsTableView;
@property (unsafe_unretained) IBOutlet NSTextView *notesTextView;
@property (weak) IBOutlet NSTextField *customFieldsTextField;
/* Seperate call to ensure alle registered objects are in place */

View File

@@ -42,19 +42,19 @@ enum {
BOOL _visible;
}
@property (assign, nonatomic) KdbEntry *selectedEntry;
@property (assign, nonatomic) KdbGroup *selectedGroup;
@property (weak, nonatomic) KdbEntry *selectedEntry;
@property (weak, nonatomic) KdbGroup *selectedGroup;
@property (retain) NSPopover *activePopover;
@property (assign) IBOutlet NSButton *generatePasswordButton;
@property (strong) NSPopover *activePopover;
@property (weak) IBOutlet NSButton *generatePasswordButton;
@property (nonatomic, assign) NSDate *modificationDate;
@property (nonatomic, assign) NSDate *creationDate;
@property (nonatomic, weak) NSDate *modificationDate;
@property (nonatomic, weak) NSDate *creationDate;
@property (nonatomic, assign) NSUInteger activeTab;
@property (assign) IBOutlet NSTabView *tabView;
@property (retain) NSArrayController *attachmentsController;
@property (retain) NSArrayController *customFieldsController;
@property (weak) IBOutlet NSTabView *tabView;
@property (strong) NSArrayController *attachmentsController;
@property (strong) NSArrayController *customFieldsController;
- (IBAction)addCustomField:(id)sender;
- (IBAction)removeCustomField:(id)sender;
@@ -81,10 +81,6 @@ enum {
- (void)dealloc {
[[NSNotificationCenter defaultCenter] removeObserver:self];
[_activePopover release];
[_attachmentsController release];
[_customFieldsController release];
[super dealloc];
}
- (void)didLoadView {
@@ -267,12 +263,12 @@ enum {
#pragma mark Popovers
- (void)_showImagePopup:(id)sender {
[self _showPopopver:[[[MPIconSelectViewController alloc] init] autorelease] atView:self.itemImageView onEdge:NSMinYEdge];
[self _showPopopver:[[MPIconSelectViewController alloc] init] atView:self.itemImageView onEdge:NSMinYEdge];
}
- (IBAction)_popUpPasswordGenerator:(id)sender {
[self.generatePasswordButton setEnabled:NO];
[self _showPopopver:[[[MPPasswordCreatorViewController alloc] init] autorelease] atView:self.passwordTextField onEdge:NSMinYEdge];
[self _showPopopver:[[MPPasswordCreatorViewController alloc] init] atView:self.passwordTextField onEdge:NSMinYEdge];
}
- (void)_showPopopver:(NSViewController *)viewController atView:(NSView *)view onEdge:(NSRectEdge)edge {
@@ -302,7 +298,6 @@ enum {
}
/* TODO: Check for Icon wizzard */
[_activePopover release];
_activePopover = nil;
}

View File

@@ -51,9 +51,7 @@ NSString *const MPShouldLockDatabaseNotification = @"com.hicknhack.macpass.MPSho
/* Timer */
[idleCheckTimer invalidate];
[idleCheckTimer release];
[super dealloc];
}
- (void)setLockOnSleep:(BOOL)lockOnSleep {
@@ -74,7 +72,6 @@ NSString *const MPShouldLockDatabaseNotification = @"com.hicknhack.macpass.MPSho
_idleLockTime = idleLockTime;
if(_idleLockTime == 0) {
[idleCheckTimer invalidate];
[idleCheckTimer release];
idleCheckTimer = nil;
}
else {
@@ -84,7 +81,7 @@ NSString *const MPShouldLockDatabaseNotification = @"com.hicknhack.macpass.MPSho
return; // Done
}
/* Create new timer and schedule it with runloop */
idleCheckTimer = [[NSTimer timerWithTimeInterval:_idleLockTime target:self selector:@selector(_checkIdleTime:) userInfo:nil repeats:YES] retain];
idleCheckTimer = [NSTimer timerWithTimeInterval:_idleLockTime target:self selector:@selector(_checkIdleTime:) userInfo:nil repeats:YES];
[[NSRunLoop mainRunLoop] addTimer:idleCheckTimer forMode:NSDefaultRunLoopMode];
}
}

View File

@@ -9,7 +9,7 @@
#import <Foundation/Foundation.h>
@interface MPLoggerProxy : NSObject
@property (retain) id original;
@property (strong) id original;
- (id)initWithOriginal:(id) value;

View File

@@ -23,11 +23,10 @@
- (BOOL)outlineView:(NSOutlineView *)outlineView writeItems:(NSArray *)items toPasteboard:(NSPasteboard *)pasteboard {
[_draggedItem release];
_draggedItem = nil;
[pasteboard setString:@"Weee" forType:MPPasteBoardType];
if([items count] == 1) {
_draggedItem = [[[items lastObject] representedObject] retain];
_draggedItem = [[items lastObject] representedObject];
return (nil != _draggedItem.parent);
}
return YES;
@@ -93,7 +92,6 @@
MPDocument *document = [[[outlineView window] windowController] document];
KdbGroup *rootGroup = [document root];
KdbEntry *draggedEntry = [rootGroup entryForUUID:uuid];
[uuid release];
if(draggedEntry) {
if(draggedEntry.parent != target && index == NSOutlineViewDropOnItemIndex) {
[document moveEntry:draggedEntry toGroup:target index:index];

View File

@@ -17,9 +17,9 @@ APPKIT_EXTERN NSString *const MPOutlineViewDidChangeGroupSelection;
@interface MPOutlineViewController : MPViewController <NSOutlineViewDelegate>
@property (readonly, assign) NSOutlineView *outlineView;
@property (assign) IBOutlet HNHGradientView *bottomBar;
@property (assign, readonly) KdbGroup *selectedGroup;
@property (readonly, weak) NSOutlineView *outlineView;
@property (weak) IBOutlet HNHGradientView *bottomBar;
@property (weak, readonly) KdbGroup *selectedGroup;
- (void)clearSelection;
- (void)showOutline;

View File

@@ -9,6 +9,7 @@
#import "MPOutlineViewController.h"
#import "MPOutlineDataSource.h"
#import "MPDocument.h"
#import "MPDocumentWindowController.h"
#import "MPContextMenuHelper.h"
#import "MPConstants.h"
#import "MPActionHelper.h"
@@ -30,13 +31,13 @@ NSString *const _MPOutlinveViewHeaderViewIdentifier = @"HeaderCell";
@interface MPOutlineViewController () {
BOOL _bindingEstablished;
}
@property (assign) IBOutlet NSOutlineView *outlineView;
@property (assign) IBOutlet NSButton *addGroupButton;
@property (assign) KdbGroup *selectedGroup;
@property (weak) IBOutlet NSOutlineView *outlineView;
@property (weak) IBOutlet NSButton *addGroupButton;
@property (weak) KdbGroup *selectedGroup;
@property (retain) NSTreeController *treeController;
@property (retain) MPOutlineDataSource *datasource;
@property (retain) NSMenu *menu;
@property (strong) NSTreeController *treeController;
@property (strong) MPOutlineDataSource *datasource;
@property (strong) NSMenu *menu;
@end
@@ -57,12 +58,6 @@ NSString *const _MPOutlinveViewHeaderViewIdentifier = @"HeaderCell";
return self;
}
- (void)dealloc {
[_treeController release];
[_datasource release];
[_menu release];
[super dealloc];
}
- (void)didLoadView {
[_outlineView setDelegate:self];
@@ -196,7 +191,7 @@ NSString *const _MPOutlinveViewHeaderViewIdentifier = @"HeaderCell";
for(NSMenuItem *item in items) {
[menu addItem:item];
}
return [menu autorelease];
return menu;
}
- (BOOL)_itemIsRootNodeAdapter:(id)item {

View File

@@ -12,8 +12,8 @@
@interface MPOverlayWindowController ()
@property (assign) BOOL isAnimating;
@property (assign) IBOutlet NSImageView *imageView;
@property (assign) IBOutlet NSTextField *textField;
@property (weak) IBOutlet NSImageView *imageView;
@property (weak) IBOutlet NSTextField *textField;
@end

View File

@@ -10,6 +10,6 @@
@interface MPPasswordCreatorViewController : MPViewController
@property (retain, readonly) NSString *generatedPassword;
@property (strong, readonly) NSString *generatedPassword;
@end

View File

@@ -17,19 +17,19 @@
@interface MPPasswordCreatorViewController () {
MPPasswordCharacterFlags _characterFlags;
}
@property (retain) NSString *password;
@property (retain) NSString *generatedPassword;
@property (strong) NSString *password;
@property (strong) NSString *generatedPassword;
@property (assign) IBOutlet NSTextField *passwordTextField;
@property (assign) IBOutlet NSTextField *passwordLengthTextField;
@property (assign) IBOutlet NSTextField *customCharactersTextField;
@property (assign) IBOutlet NSSlider *passwordLengthSlider;
@property (assign) IBOutlet NSButton *addPasswordToPasteboardButton;
@property (assign) IBOutlet NSButton *upperCaseButton;
@property (assign) IBOutlet NSButton *lowerCaseButton;
@property (assign) IBOutlet NSButton *numbersButton;
@property (assign) IBOutlet NSButton *symbolsButton;
@property (assign) IBOutlet NSButton *customButton;
@property (weak) IBOutlet NSTextField *passwordTextField;
@property (weak) IBOutlet NSTextField *passwordLengthTextField;
@property (weak) IBOutlet NSTextField *customCharactersTextField;
@property (weak) IBOutlet NSSlider *passwordLengthSlider;
@property (weak) IBOutlet NSButton *addPasswordToPasteboardButton;
@property (weak) IBOutlet NSButton *upperCaseButton;
@property (weak) IBOutlet NSButton *lowerCaseButton;
@property (weak) IBOutlet NSButton *numbersButton;
@property (weak) IBOutlet NSButton *symbolsButton;
@property (weak) IBOutlet NSButton *customButton;
@property (assign, nonatomic) BOOL useCustomString;
@property (assign, nonatomic) NSUInteger passwordLength;
@@ -54,11 +54,6 @@
return self;
}
- (void)dealloc {
[_generatedPassword release];
[_password release];
[super dealloc];
}
- (void)didLoadView {
[self.passwordLengthSlider setMinValue:MIN_PASSWORD_LENGTH];

View File

@@ -12,9 +12,9 @@
#import "MPDocument.h"
@interface MPPasswordEditViewController ()
@property (assign) IBOutlet NSSecureTextField *passwordTextField;
@property (assign) IBOutlet NSPathControl *keyfilePathControl;
@property (retain) MPKeyfilePathControlDelegate *pathControlDelegate;
@property (weak) IBOutlet NSSecureTextField *passwordTextField;
@property (weak) IBOutlet NSPathControl *keyfilePathControl;
@property (strong) MPKeyfilePathControlDelegate *pathControlDelegate;
- (IBAction)_change:(id)sender;
- (IBAction)_cancel:(id)sender;
@@ -35,10 +35,6 @@
return self;
}
- (void)dealloc {
[_pathControlDelegate release];
[super dealloc];
}
- (NSResponder *)reconmendedFirstResponder {
return self.passwordTextField;

View File

@@ -13,11 +13,11 @@
@interface MPPasswordInputController ()
@property (assign) IBOutlet NSTextField *passwordTextField;
@property (assign) IBOutlet NSPathControl *keyPathControl;
@property (retain) MPKeyfilePathControlDelegate *pathControlDelegate;
@property (assign) IBOutlet NSImageView *errorImageView;
@property (assign) IBOutlet NSTextField *errorInfoTextField;
@property (weak) IBOutlet NSTextField *passwordTextField;
@property (weak) IBOutlet NSPathControl *keyPathControl;
@property (strong) MPKeyfilePathControlDelegate *pathControlDelegate;
@property (weak) IBOutlet NSImageView *errorImageView;
@property (weak) IBOutlet NSTextField *errorInfoTextField;
- (IBAction)_decrypt:(id)sender;
@@ -29,10 +29,6 @@
return [[MPPasswordInputController alloc] initWithNibName:@"PasswordInputView" bundle:nil];
}
- (void)dealloc {
[_pathControlDelegate release];
[super dealloc];
}
- (void)didLoadView {
[self.keyPathControl setDelegate:self.pathControlDelegate];

View File

@@ -41,7 +41,6 @@
if(_clearPasteboardOnShutdown) {
[[NSNotificationCenter defaultCenter] removeObserver:self];
}
[super dealloc];
}
- (void)_updateNotifications {

View File

@@ -76,7 +76,6 @@
// [[NSColor whiteColor] set];
// [triangle fill];
[shadow release];
[[NSGraphicsContext currentContext] restoreGraphicsState];
}
[super drawRect:dirtyRect];
@@ -106,7 +105,6 @@
owner:self
userInfo:nil];
[self addTrackingArea:trackingArea];
[trackingArea release];
}
@end

View File

@@ -29,7 +29,7 @@ NSString *const MPRequestTypeGeneratePassword = @"generate-password";
static NSDictionary *requestHandler;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
requestHandler = [[self _setupHandlerDictionary] retain];
requestHandler = [self _setupHandlerDictionary];
});
return requestHandler;
}
@@ -41,8 +41,6 @@ NSString *const MPRequestTypeGeneratePassword = @"generate-password";
[associateHandler identifier] : associateHandler,
[testAssociateHandler identifier] : testAssociateHandler
};
[associateHandler release];
[testAssociateHandler release];
return handlerDict;
}

View File

@@ -12,9 +12,9 @@
@interface MPRootAdapter : NSObject
@property (readonly, retain) NSArray *groups;
@property (nonatomic, retain) KdbTree *tree;
@property (readonly, strong) NSArray *groups;
@property (nonatomic, strong) KdbTree *tree;
/* Subs to support interface */
@property (readonly, nonatomic) NSArray *entries;
@property (weak, readonly, nonatomic) NSArray *entries;
@end

View File

@@ -11,21 +11,16 @@
@interface MPRootAdapter ()
@property (retain) NSArray *groups;
@property (strong) NSArray *groups;
@end
@implementation MPRootAdapter
- (void)dealloc {
[_groups release];
[super dealloc];
}
- (void)setTree:(KdbTree *)tree {
if(_tree != tree) {
[_tree release];
_tree = [tree retain];
_tree = tree;
self.groups = @[_tree.root];
}
}

View File

@@ -11,6 +11,6 @@
/* Simple View with an additional Button to add an Action to selected rows */
@interface MPSelectedAttachmentTableCellView : NSTableCellView
@property (nonatomic, assign) IBOutlet NSButton *saveButton;
@property (nonatomic, weak) IBOutlet NSButton *saveButton;
@end

View File

@@ -38,12 +38,6 @@
return self;
}
- (void)dealloc
{
[statusItem release];
[server release];
[super dealloc];
}
- (void)setIsEnabled:(BOOL)enabled {
if(_isEnabled == enabled) {
@@ -62,7 +56,6 @@
}
else {
/* Do not let the resource linger around */
[server release];
server = nil;
}
[self _updateStatusItem];
@@ -78,7 +71,7 @@
- (void)_updateStatusItem {
if(_isEnabled && _showStatusItem) {
statusItem = [[[NSStatusBar systemStatusBar] statusItemWithLength:NSVariableStatusItemLength] retain];
statusItem = [[NSStatusBar systemStatusBar] statusItemWithLength:NSVariableStatusItemLength];
[statusItem setImage:[MPIconHelper icon:MPIconServer ]];
}
else if(statusItem) {

View File

@@ -11,6 +11,6 @@
@interface MPServerSettingsController : MPViewController <MPSettingsTab>
@property (assign) IBOutlet NSButton *enableServerCheckbutton;
@property (weak) IBOutlet NSButton *enableServerCheckbutton;
@end

View File

@@ -14,10 +14,10 @@
NSString *lastIdentifier;
}
@property (retain, nonatomic) NSToolbar *toolbar;
@property (retain, nonatomic) NSMutableDictionary *settingsController;
@property (retain, nonatomic) NSMutableDictionary *toolbarItems;
@property (retain) NSArray *defaultToolbarItems;
@property (strong, nonatomic) NSToolbar *toolbar;
@property (strong, nonatomic) NSMutableDictionary *settingsController;
@property (strong, nonatomic) NSMutableDictionary *toolbarItems;
@property (strong) NSArray *defaultToolbarItems;
@end
@@ -41,13 +41,6 @@
return self;
}
- (void)dealloc {
[_settingsController release];
[_toolbar release];
[_toolbarItems release];
[_defaultToolbarItems release];
[super dealloc];
}
- (void)showSettings {
if([self.defaultToolbarItems count] > 0) {
@@ -122,8 +115,6 @@
self.defaultToolbarItems = @[ [generalSettingsController identifier], [serverSettingsController identifier] ];
[generalSettingsController release];
[serverSettingsController release];
}

View File

@@ -35,7 +35,6 @@
NSColor *bottomColor = [NSColor colorWithCalibratedWhite:0.85 alpha:1];
NSGradient *gradient = [[NSGradient alloc] initWithColors:@[topColor, bottomColor ]];
[gradient drawInRect:dirtyRect angle:-90];
[gradient release];
NSShadow *dropShadow = [[NSShadow alloc] init];
[dropShadow setShadowColor:[NSColor colorWithCalibratedWhite:0 alpha:0.5]];
@@ -54,7 +53,6 @@
[[NSBezierPath bezierPathWithOvalInRect:bottomElipsis] fill];
}
[dropShadow release];
[[NSGraphicsContext currentContext] restoreGraphicsState];
}

View File

@@ -25,7 +25,6 @@ NSString *const MPStringLengthValueTransformerName = @"com.hicknhack.macpass.MPM
MPStringLengthValueTransformer *transformer = [[MPStringLengthValueTransformer alloc] init];
[NSValueTransformer setValueTransformer:transformer
forName:MPStringLengthValueTransformerName];
[transformer release];
}
- (id)transformedValue:(id)value {

View File

@@ -12,6 +12,6 @@
@interface MPToolbarDelegate : NSObject <NSToolbarDelegate>
@property (assign) NSToolbarItem *searchItem;
@property (weak) NSToolbarItem *searchItem;
@end

View File

@@ -24,9 +24,9 @@ NSString *const MPToolbarItemInspector = @"TOOLBAR_INSPECTOR";
@interface MPToolbarDelegate()
@property (retain) NSMutableDictionary *toolbarItems;
@property (retain) NSArray *toolbarIdentifiers;
@property (retain) NSDictionary *toolbarImages;
@property (strong) NSMutableDictionary *toolbarItems;
@property (strong) NSArray *toolbarIdentifiers;
@property (strong) NSDictionary *toolbarImages;
- (NSString *)_localizedLabelForToolbarItemIdentifier:(NSString *)identifier;
- (SEL)_actionForToolbarItemIdentifier:(NSString *)identifier;
@@ -39,20 +39,13 @@ NSString *const MPToolbarItemInspector = @"TOOLBAR_INSPECTOR";
- (id)init {
self = [super init];
if (self) {
_toolbarIdentifiers = [@[ MPToolbarItemAddEntry, MPToolbarItemDelete, MPToolbarItemAddGroup, MPToolbarItemAction, NSToolbarFlexibleSpaceItemIdentifier, MPToolbarItemLock, MPToolbarItemInspector ] retain];
_toolbarImages = [[self createToolbarImages] retain];
_toolbarIdentifiers = @[ MPToolbarItemAddEntry, MPToolbarItemDelete, MPToolbarItemAddGroup, MPToolbarItemAction, NSToolbarFlexibleSpaceItemIdentifier, MPToolbarItemLock, MPToolbarItemInspector ];
_toolbarImages = [self createToolbarImages];
_toolbarItems = [[NSMutableDictionary alloc] initWithCapacity:[self.toolbarIdentifiers count]];
}
return self;
}
- (void)dealloc
{
[_toolbarItems release];
[_toolbarIdentifiers release];
[_toolbarImages release];
[super dealloc];
}
- (NSToolbarItem *)toolbar:(NSToolbar *)toolbar itemForItemIdentifier:(NSString *)itemIdentifier willBeInsertedIntoToolbar:(BOOL)flag {
NSToolbarItem *item = self.toolbarItems[itemIdentifier];
@@ -75,7 +68,6 @@ NSString *const MPToolbarItemInspector = @"TOOLBAR_INSPECTOR";
NSMenuItem *actionImageItem = [[NSMenuItem allocWithZone:[NSMenu menuZone]] initWithTitle:@"" action:NULL keyEquivalent:@""];
[actionImageItem setImage:self.toolbarImages[MPToolbarItemAction]];
[menu addItem:actionImageItem];
[actionImageItem release];
NSArray *menuItems = [MPContextMenuHelper contextMenuItemsWithItems:MPContextMenuExtended];
for(NSMenuItem *item in menuItems) {
[menu addItem:item];
@@ -88,10 +80,7 @@ NSString *const MPToolbarItemInspector = @"TOOLBAR_INSPECTOR";
[popupButton setFrame:newFrame];
[popupButton setMenu:menu];
[item setMenuFormRepresentation:menuRepresentation];
[menuRepresentation release];
[item setView:popupButton];
[popupButton release];
[menu release];
}
else {
NSButton *button = [[MPToolbarButton alloc] initWithFrame:NSMakeRect(0, 0, 32, 32)];
@@ -114,11 +103,8 @@ NSString *const MPToolbarItemInspector = @"TOOLBAR_INSPECTOR";
action:[self _actionForToolbarItemIdentifier:itemIdentifier]
keyEquivalent:@""];
[item setMenuFormRepresentation:menuRepresentation];
[menuRepresentation release];
[button release];
}
self.toolbarItems[itemIdentifier] = item;
[item release];
}
return item;
}

View File

@@ -24,7 +24,6 @@ NSString *const MPUppsercaseStringValueTransformerName = @"com.hicknhack.macpass
MPUppercaseStringValueTransformer *transformer = [[MPUppercaseStringValueTransformer alloc] init];
[NSValueTransformer setValueTransformer:transformer
forName:MPUppsercaseStringValueTransformerName];
[transformer release];
}
- (id)transformedValue:(id)value {

View File

@@ -48,7 +48,7 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1846</string>
<string>1872</string>
<key>LSMinimumSystemVersion</key>
<string>${MACOSX_DEPLOYMENT_TARGET}</string>
<key>NSHumanReadableCopyright</key>

View File

@@ -49,7 +49,7 @@ static NSString *allowedCharactersString(MPPasswordCharacterFlags flags) {
while([password length] < length) {
[password appendString:[source randomCharacter]];
}
return [password autorelease];
return password;
}
+ (NSString *)passwordWithCharactersets:(MPPasswordCharacterFlags)allowedCharacters length:(NSUInteger)length {