mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-24 00:39:22 +00:00
Added category for easy item copying with respect to UUID uniqueness
This commit is contained in:
15
MacPass/KPKEntry+TemplateCopy.h
Normal file
15
MacPass/KPKEntry+TemplateCopy.h
Normal file
@@ -0,0 +1,15 @@
|
||||
//
|
||||
// KPKEntry+TemplateCopy.h
|
||||
// MacPass
|
||||
//
|
||||
// Created by Michael Starke on 01/12/13.
|
||||
// Copyright (c) 2013 HicknHack Software GmbH. All rights reserved.
|
||||
//
|
||||
|
||||
#import "KPKEntry.h"
|
||||
|
||||
@interface KPKEntry (TemplateCopy)
|
||||
|
||||
- (instancetype)copyWithTitle:(NSString *)title;
|
||||
|
||||
@end
|
||||
22
MacPass/KPKEntry+TemplateCopy.m
Normal file
22
MacPass/KPKEntry+TemplateCopy.m
Normal file
@@ -0,0 +1,22 @@
|
||||
//
|
||||
// KPKEntry+TemplateCopy.m
|
||||
// MacPass
|
||||
//
|
||||
// Created by Michael Starke on 01/12/13.
|
||||
// Copyright (c) 2013 HicknHack Software GmbH. All rights reserved.
|
||||
//
|
||||
|
||||
#import "KPKEntry+TemplateCopy.h"
|
||||
#import "KPKTimeInfo.h"
|
||||
|
||||
@implementation KPKEntry (TemplateCopy)
|
||||
|
||||
- (instancetype)copyWithTitle:(NSString *)title {
|
||||
KPKEntry *copy = [self copy];
|
||||
copy.uuid = [[NSUUID alloc] init];
|
||||
copy.timeInfo.creationTime = [NSDate date];
|
||||
copy.title = title;
|
||||
return copy;
|
||||
}
|
||||
|
||||
@end
|
||||
15
MacPass/KPKGroup+TemplateCopy.h
Normal file
15
MacPass/KPKGroup+TemplateCopy.h
Normal file
@@ -0,0 +1,15 @@
|
||||
//
|
||||
// KPKGroup+TemplateCopy.h
|
||||
// MacPass
|
||||
//
|
||||
// Created by Michael Starke on 01/12/13.
|
||||
// Copyright (c) 2013 HicknHack Software GmbH. All rights reserved.
|
||||
//
|
||||
|
||||
#import "KPKGroup.h"
|
||||
|
||||
@interface KPKGroup (TemplateCopy)
|
||||
|
||||
- (instancetype)copyWithName:(NSString *)name;
|
||||
|
||||
@end
|
||||
22
MacPass/KPKGroup+TemplateCopy.m
Normal file
22
MacPass/KPKGroup+TemplateCopy.m
Normal file
@@ -0,0 +1,22 @@
|
||||
//
|
||||
// KPKGroup+TemplateCopy.m
|
||||
// MacPass
|
||||
//
|
||||
// Created by Michael Starke on 01/12/13.
|
||||
// Copyright (c) 2013 HicknHack Software GmbH. All rights reserved.
|
||||
//
|
||||
|
||||
#import "KPKGroup+TemplateCopy.h"
|
||||
#import "KPKTimeInfo.h"
|
||||
|
||||
@implementation KPKGroup (TemplateCopy)
|
||||
|
||||
- (instancetype)copyWithName:(NSString *)name {
|
||||
KPKGroup *copy = [self copy];
|
||||
copy.uuid = [[NSUUID alloc] init];
|
||||
copy.timeInfo.creationTime = [NSDate date];
|
||||
copy.name = name;
|
||||
return copy;
|
||||
}
|
||||
|
||||
@end
|
||||
Reference in New Issue
Block a user