Browse files

Various fixes and updates

  • Loading branch information...
1 parent d835981 commit 008b0c72ae18a2dfe43cda159f3b40a046ddefa8 @pjrobertson pjrobertson committed May 19, 2012
Showing with 192 additions and 220 deletions.
  1. +9 −7 Info.plist
  2. +0 −2 OnePasswordAction.h
  3. +32 −47 OnePasswordAction.m
  4. +3 −0 OnePasswordDefines.h
  5. +0 −2 OnePasswordSource.h
  6. +148 −162 OnePasswordSource.m
View
16 Info.plist
@@ -4,20 +4,22 @@
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
+ <key>CFBundleDisplayName</key>
+ <string>1Password Plugin</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>com.robertson.Quicksilver.OnePassword</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
- <string>1Password Module</string>
+ <string>1Password Plugin</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
- <string>2.4.1</string>
+ <string>2.6.0</string>
<key>CFBundleVersion</key>
- <string>30E</string>
+ <string>33C</string>
<key>QSActions</key>
<dict>
<key>goAndFill</key>
@@ -93,9 +95,9 @@
<string>&lt;h3&gt;1Password 3 Plugin&lt;/h3&gt;
&lt;p&gt;This plugin has taken a lot of development time. If you enjoy using it, please consider &lt;a href="http://patjack.co.uk/donating-for-my-quicksilver-1password-plugin/"&gt;donating&lt;/a&gt;.&lt;/p&gt;
-
&lt;p&gt;This plugin enables right arrowing into the 1Password application, giving access to data saved in 1Password&lt;br /&gt;&lt;p&gt;Web logins objects, have 'Go &amp; Fill' action, as well as a 'Go &amp; Fill With...' action. &lt;/p&gt;&lt;p&gt;These actions works with the comma trick, so you can open multiple logins at once, or open them in multiple browsers&lt;/p&gt;&lt;p&gt;1Password data can be indexed directly in the Quicksilver catalog by 'ticking' any of the 1Password data types in the Preferences→Catalog→Modules pane (disabled by default)&lt;br /&gt;
This plugin also adds support for 'Reveal in 1Password' for all data types: web forms, accounts, software, identities, wallet items and notes using the action 'Reveal in 1Password'&lt;/p&gt;</string>
+
&lt;p&gt;This plugin enables right arrowing into the 1Password application, giving access to data saved in 1Password&lt;br /&gt;&lt;p&gt;Web logins objects, have 'Go &amp; Fill' action, as well as a 'Go &amp; Fill With...' action. &lt;/p&gt;&lt;p&gt;These actions works with the comma trick, so you can open multiple logins at once, or open them in multiple browsers&lt;/p&gt;&lt;p&gt;1Password data can be indexed directly in the Quicksilver catalog by 'ticking' any of the 1Password data types in the Preferences→Catalog→Plugins pane (disabled by default)&lt;br /&gt;
This plugin also adds support for 'Reveal in 1Password' for all data types: web forms, accounts, software, identities, wallet items and notes using the action 'Reveal in 1Password'&lt;/p&gt;</string>
<key>icon</key>
- <string>ws.agile.1Password</string>
+ <string>com.agilebits.onepassword-osx</string>
</dict>
<key>QSPresetAdditions</key>
<array>
@@ -110,7 +112,7 @@
<key>enabled</key>
<true/>
<key>icon</key>
- <string>ws.agile.1Password</string>
+ <string>com.agilebits.onepassword-osx</string>
<key>name</key>
<string>Logins</string>
<key>source</key>
@@ -190,7 +192,7 @@
</dict>
</array>
<key>icon</key>
- <string>ws.agile.1Password</string>
+ <string>com.agilebits.onepassword-osx</string>
<key>name</key>
<string>1Password</string>
<key>source</key>
View
2 OnePasswordAction.h
@@ -44,11 +44,9 @@
NSString *bundleID;
}
-- (void)formURLAndFillWith:(QSObject *)dObject andBrowsers:(QSObject *)iObject;
- (QSObject *)viewInOnePwd:(QSObject *)dObject;
- (QSObject *)goAndFill:(QSObject *)dObject;
- (QSObject *)goAndFill:(QSObject *)dObject with:(QSObject *)iObject;
-//- (QSObject *)trashForm:(QSObject *)dObject;
@end
View
79 OnePasswordAction.m
@@ -92,21 +92,38 @@ - (QSObject *)goAndFill:(QSObject *)dObject{
- (QSObject *)goAndFill:(QSObject *)dObject with:(QSObject *)iObject {
- // for each object - do exactly the same thing as for single objects
- // ß61 method
- //for (QSObject *goAndFillObject in [dObject splitObjects]) {
-// [self writePlistAndFill:goAndFillObject withBrowsers:iObject];
-// }
- if ([dObject count] > 1) {
- for (QSObject *goAndFillObject in [dObject objectForCache:kQSObjectComponents]) {
- [self formURLAndFillWith:goAndFillObject andBrowsers:iObject];
- }
- }
- else {
- [self formURLAndFillWith:dObject andBrowsers:iObject];
- }
-
-
+ NSWorkspace *ws = [NSWorkspace sharedWorkspace];
+
+ NSMutableArray *URLArray = [[NSMutableArray alloc] initWithCapacity:[dObject count]];
+ for (QSObject *goAndFillObject in [dObject splitObjects]) {
+
+ NSString *appendedString = [NSString stringWithFormat:@"?onepasswdfill=%@",[goAndFillObject identifier]];
+ NSString *URLString = [goAndFillObject details];
+
+ URLString = [URLString stringByAppendingString:appendedString];
+ NSURL *URL = [NSURL URLWithString:[URLString URLEncoding]];
+ [URLArray addObject:URL];
+
+ }
+
+ if (!iObject) {
+ [ws openURLs:URLArray withAppBundleIdentifier:nil
+ options:0
+ additionalEventParamDescriptor:nil
+ launchIdentifiers:nil];
+ } else {
+ for(QSObject *individual in [iObject splitObjects]){
+ if([individual isApplication]) {
+ NSString *ident = [[NSBundle bundleWithPath:[individual singleFilePath]] bundleIdentifier];
+ [ws openURLs:URLArray withAppBundleIdentifier:ident
+ options:0
+additionalEventParamDescriptor:nil
+ launchIdentifiers:nil];
+
+ }
+ }
+ }
+ [URLArray release];
return nil;
}
@@ -188,38 +205,6 @@ - (QSObject *)viewInOnePwd:(QSObject *)dObject {
return nil;
}
--(void)formURLAndFillWith:(QSObject *)dObject andBrowsers:(QSObject *)iObject {
- // Create the appropriate URL
-
- NSString *appendedString = [NSString stringWithFormat:@"?onepasswdfill=%@",[dObject identifier]];
- NSString *URLString = [dObject details];
-
- URLString = [URLString stringByAppendingString:appendedString];
- NSURL *URL = [NSURL URLWithString:[URLString URLEncoding]];
- NSWorkspace *ws = [NSWorkspace sharedWorkspace];
-
-
- // Open the URL in the default browser
- if(!iObject) {
- [ws openURL:URL];
- }
-
- else {
- for(QSObject *individual in [iObject splitObjects]){
- if([individual isApplication]) {
- NSString *ident = [[NSBundle bundleWithPath:[individual singleFilePath]] bundleIdentifier];
- [ws openURLs:[NSArray arrayWithObject:URL] withAppBundleIdentifier:ident
- options:0
-additionalEventParamDescriptor:nil
- launchIdentifiers:nil];
-
- }
- }
- }
-
-}
-
-
//-(QSObject *)trashForm:(QSObject *)dObject
//{
View
3 OnePasswordDefines.h
@@ -2,6 +2,9 @@
#define kOldKeychainLocation @"~/Library/Application Support/1Password/1Password.agilekeychain"
#define kNewMASKeychainLocation @"~/Library/Containers/com.agilebits.onepassword-osx-helper/Data/Documents/1Password.agilekeychain"
#define kDropboxLocation @"~/Dropbox/1Password/1Password.agilekeychain"
+#define kOldDropboxLocation @"~/Dropbox/1Password.agilekeychain"
+
+#define kKeychainPathArray [NSArray arrayWithObjects:kOldKeychainLocation,kNewMASKeychainLocation,kDropboxLocation,kOldDropboxLocation,nil]
// QSObject type defines
#define QS1PasswordForm @"QS1PasswordForm"
View
2 OnePasswordSource.h
@@ -28,11 +28,9 @@
{
NSString *bundleID;
NSString *keychainPath;
- NSImage *onePasswordImage;
}
@property (retain) NSString *bundleID;
@property (retain) NSString *keychainPath;
-@property (retain) NSImage *onePasswordImage;
+(id)sharedInstance;
@end
View
310 OnePasswordSource.m
@@ -1,3 +1,4 @@
+
//
// OnePasswordSource.m
// OnePassword
@@ -29,12 +30,11 @@
@implementation OnePasswordSource
-@synthesize bundleID, keychainPath, onePasswordImage;
+@synthesize bundleID, keychainPath;
-(void)dealloc {
[bundleID release];
[keychainPath release];
- [onePasswordImage release];
[super dealloc];
}
@@ -56,46 +56,29 @@ -(id)init {
}
// NSLog(@"1Password Bundle ID: %@",[self bundleID]);
- NSString *tempKeychainPath = nil;
-
- NSString *CFkeychainPath = (NSString *)CFPreferencesCopyAppValue((CFStringRef)@"AgileKeychainLocation",(CFStringRef) @"ws.agile.1Password");
+ NSString *tempKeychainPath = [(NSString *)CFPreferencesCopyAppValue((CFStringRef)@"AgileKeychainLocation",(CFStringRef) @"ws.agile.1Password") autorelease];
NSFileManager *fm = [[NSFileManager alloc] init];
- if (CFkeychainPath) {
-// NSLog(@"Found keychain location from ws.agile.1Password plist for key AgileKeychainLocation");
- tempKeychainPath = [CFkeychainPath mutableCopy];
- }
-
- [CFkeychainPath release];
-
- if (!tempKeychainPath || (tempKeychainPath && ![fm fileExistsAtPath:[tempKeychainPath stringByStandardizingPath]])) {
-// NSLog(@"DropBoxEnabled BOOL is set in ws.agile.1Password.plist, assuming keychain is in the dropbox folder");
- tempKeychainPath = [[NSString alloc] initWithString:kDropboxLocation];
- }
-
- if (!tempKeychainPath || (tempKeychainPath && ![fm fileExistsAtPath:[tempKeychainPath stringByStandardizingPath]])) {
-// NSLog(@"Assuming 1Password keychain is in ~/Library/Containers folder");
- tempKeychainPath = [[NSString alloc] initWithString:kNewMASKeychainLocation];
- }
if (!tempKeychainPath || (tempKeychainPath && ![fm fileExistsAtPath:[tempKeychainPath stringByStandardizingPath]])) {
-// NSLog(@"Assuming 1Password keychain is in ~/Library/App Support folder");
- tempKeychainPath = [[NSString alloc] initWithString:kOldKeychainLocation];
+ for (NSString *testKeychainPath in kKeychainPathArray) {
+ if ([fm fileExistsAtPath:[testKeychainPath stringByStandardizingPath]]) {
+ tempKeychainPath = testKeychainPath;
+ break;
+ }
+ }
+
}
-
+
if (!tempKeychainPath || (tempKeychainPath && ![fm fileExistsAtPath:[tempKeychainPath stringByStandardizingPath]])) {
NSLog(@"Could not determine where your keychain resides.\n Tried everything for Bundle ID: %@, all I came up with was keychain: %@",
[self bundleID], keychainPath);
}
[self setKeychainPath:[tempKeychainPath stringByStandardizingPath]];
[fm release];
- [tempKeychainPath release];
}
-
- // save the 1pass image as it's used a lot
- [self setOnePasswordImage:[QSResourceManager imageNamed:[self bundleID]]];
-
+
return self;
}
@@ -141,162 +124,165 @@ - (BOOL)loadChildrenForObject:(QSObject *)object {
- (NSArray *)objectsForEntry:(NSDictionary *)theEntry{
-
- // Define the objects (Empty to start with) we're going to send back to QS
- NSMutableArray *objects=[[NSMutableArray alloc] init];
-
- // Get into the data folder of it
- NSString *dataFolder = [[self keychainPath] stringByAppendingPathComponent:@"data/default/"];
-
+ // Get into the data folder of it
+ NSString *dataFolder = [[self keychainPath] stringByAppendingPathComponent:@"data/default/"];
+
NSFileManager *fm = [[NSFileManager alloc] init];
if (![self keychainPath] || ![fm fileExistsAtPath:[self keychainPath]]) {
NSLog(@"Unable to determine 1Password keychain path. Assumed it was in %@, but file not found.",[self keychainPath]);
return nil;
}
- // get all the files in the directory
- NSError *dataError = nil;
- NSArray *dataFiles = [fm contentsOfDirectoryAtPath:dataFolder error:&dataError];
-
- [fm release];
-
- if(dataError) {
- NSLog(@"Error: %@",dataError);
- return nil;
- }
-
- // Set this up to get only the files ending in .1pwd
- NSPredicate *contains1Pwd = [NSPredicate predicateWithFormat:@"SELF ENDSWITH[c] '1Password'"];
-
- // Set the 1Pwd bundle to access the images
- NSBundle *OnePasswordBundle = [NSBundle bundleWithIdentifier:bundleID];
-
-
- // For each .1pwd file in the filtered files
- for (NSString *dataPath in [dataFiles filteredArrayUsingPredicate:contains1Pwd])
- {
-
- NSData *JSONData = [NSData dataWithContentsOfFile:[dataFolder stringByAppendingPathComponent:dataPath]];
- NSDictionary *JSONDict = [JSONData yajl_JSON];
-
- // If there's something wrong with the JSON Dictionary
- if(!JSONDict) {
- NSLog(@"Error getting JSONDict");
- continue;
- }
- // Don't catalog trashed items
- if([JSONDict objectForKey:@"trashed"]) {
- continue;
- }
-
- NSString *type = [theEntry objectForKey:kItemType];
- NSString *objectType = [JSONDict objectForKey:@"typeName"];
-
- // Ignore password types
- if ([objectType isEqualToString:@"passwords.Password"]) {
- continue;
- }
-
- NSString *title = [JSONDict objectForKey:@"title"];
- NSString *uuidString = [JSONDict objectForKey:@"uuid"];
-
- QSObject *newObject;
- newObject=[QSObject makeObjectWithIdentifier:uuidString];
- [newObject setLabel:title];
- [newObject setName:title];
-
- // if it's a webform
- if([objectType isEqualToString:@"webforms.WebForm"])
- {
- if ([type isEqualToString:@"WebForm"] || [[theEntry objectForKey:@"LoadingChildren"] boolValue]) {
-
- NSString *location = [JSONDict objectForKey:@"location"];
- [newObject setObject:uuidString forType:QS1PasswordForm];
- [newObject setDetails:location];
- [newObject setIcon:onePasswordImage];
- [newObject setObject:[JSONDict objectForKey:@"locationKey"] forMeta:@"locationKey"];
- [objects addObject:newObject];
- }
- }
- else {
- [newObject setDetails:title];
-
- // if it's an identity
- if ([objectType isEqualToString:@"identities.Identity"])
- {
- if ([type isEqualToString:@"Identity"] || [[theEntry objectForKey:@"LoadingChildren"] boolValue]) {
-
- [newObject setObject:uuidString forType:QS1PasswordIdentity];
- [newObject setIcon:[QSResourceManager imageNamed:@"UserIcon"]];
- [objects addObject:newObject];
- }
- }
-
- // else if it's a wallet or sofware license (wallet items are wallet.financial, software licenses are wallet.computer)
- else if ([objectType hasPrefix:@"wallet.financial"])
- {
- if ([type isEqualToString:@"WalletItem"] || [[theEntry objectForKey:@"LoadingChildren"] boolValue]) {
- [newObject setObject:title forType:QS1PasswordWalletItem];
- [newObject setIcon:[[[NSImage alloc] initByReferencingFile:[OnePasswordBundle pathForResource:@"wallet-icon-128" ofType:@"png"]] autorelease]];
- [objects addObject:newObject];
- }
- }
-
- // else if it's a software license
- else if ([objectType hasPrefix:@"wallet.computer"])
- {
- if ([type isEqualToString:@"SoftwareLicense"] || [[theEntry objectForKey:@"LoadingChildren"] boolValue]) {
- [newObject setObject:title forType:QS1PasswordSoftwareLicense];
- [newObject setIcon:[QSResourceManager imageNamed:@"ToolbarAppsFolderIcon"]];
- [objects addObject:newObject];
- }
- }
-
- // else if it's an online service
- else if ([objectType hasPrefix:@"wallet.onlineservices"])
- {
- if ([type isEqualToString:@"OnlineService"] || [[theEntry objectForKey:@"LoadingChildren"] boolValue]) {
- [newObject setObject:title forType:QS1PasswordOnlineService];
- [newObject setIcon:[[[NSImage alloc] initByReferencingFile:[OnePasswordBundle pathForResource:@"logins-icon-128" ofType:@"png"]] autorelease]];
- [objects addObject:newObject];
- }
- }
-
- // else if it's a secure note
- else if ([objectType isEqualToString:@"securenotes.SecureNote"])
- {
- if ([type isEqualToString:@"SecureNote"] || [[theEntry objectForKey:@"LoadingChildren"] boolValue]) {
-
- [newObject setObject:title forType:QS1PasswordSecureNote];
- [newObject setIcon:[[[NSImage alloc] initByReferencingFile:[OnePasswordBundle pathForResource:@"secure-notes-icon-128" ofType:@"png"]]autorelease]];
- [objects addObject:newObject];
- }
- }
- }
- }
- return objects;
+ // get all the files in the directory
+ NSError *dataError = nil;
+ NSArray *dataFiles = [fm contentsOfDirectoryAtPath:dataFolder error:&dataError];
+
+ [fm release];
+
+ if(dataError) {
+ NSLog(@"Error: %@",dataError);
+ return nil;
+ }
+
+ // Define the objects (Empty to start with) we're going to send back to QS
+ NSMutableArray *objects=[[NSMutableArray alloc] init];
+
+ // Set this up to get only the files ending in .1pwd
+ NSPredicate *contains1Pwd = [NSPredicate predicateWithFormat:@"SELF ENDSWITH[c] '1Password'"];
+
+ // Set the 1Pwd bundle to access the images
+ NSBundle *OnePasswordBundle = [NSBundle bundleWithIdentifier:bundleID];
+
+ NSArray *filteredFiles = [dataFiles filteredArrayUsingPredicate:contains1Pwd];
+
+ @autoreleasepool {
+ // For each .1pwd file in the filtered files
+ for (NSString *dataPath in filteredFiles)
+ {
+
+ NSData *JSONData = [NSData dataWithContentsOfFile:[dataFolder stringByAppendingPathComponent:dataPath]];
+ NSDictionary *JSONDict = [JSONData yajl_JSON];
+
+ // If there's something wrong with the JSON Dictionary
+ if(!JSONDict) {
+ NSLog(@"Error getting JSONDict");
+ continue;
+ }
+ // Don't catalog trashed items
+ if([JSONDict objectForKey:@"trashed"]) {
+ continue;
+ }
+
+ // Get the type of search we're performing: right arrow or a preset type as defined in the catalog prefs
+ NSString *type = [theEntry objectForKey:kItemType];
+
+ // get the 1Password type from the JSONDict (webform, wallet item etc.)
+ NSString *objectType = [JSONDict objectForKey:@"typeName"];
+
+ // Ignore password types
+ if ([objectType isEqualToString:@"passwords.Password"]) {
+ continue;
+ }
+ NSString *title = [JSONDict objectForKey:@"title"];
+ NSString *uuidString = [JSONDict objectForKey:@"uuid"];
+
+ QSObject *newObject =nil;
+
+ // if it's a webform
+ if([objectType isEqualToString:@"webforms.WebForm"])
+ {
+ if ([type isEqualToString:@"WebForm"] || [[theEntry objectForKey:@"LoadingChildren"] boolValue]) {
+ NSString *location = [JSONDict objectForKey:@"location"];
+ newObject = [QSObject makeObjectWithIdentifier:[NSString stringWithFormat:@"%@-%@",location,uuidString]];
+ [newObject setName:location];
+ [newObject setObject:uuidString forType:QS1PasswordForm];
+ [newObject setDetails:location];
+ [newObject setLabel:title];
+ [newObject setIcon:[QSResourceManager imageNamed:bundleID]];
+ [newObject setObject:[JSONDict objectForKey:@"locationKey"] forMeta:@"locationKey"];
+ [objects addObject:newObject];
+ }
+ }
+ else {
+ newObject=[QSObject makeObjectWithIdentifier:uuidString];
+ [newObject setName:title];
+ [newObject setLabel:title];
+ // if it's an identity
+ if ([objectType isEqualToString:@"identities.Identity"])
+ {
+ if ([type isEqualToString:@"Identity"] || [[theEntry objectForKey:@"LoadingChildren"] boolValue]) {
+ [newObject setObject:uuidString forType:QS1PasswordIdentity];
+ [newObject setIcon:[QSResourceManager imageNamed:@"UserIcon"]];
+ [objects addObject:newObject];
+ }
+ }
+
+ // else if it's a wallet or sofware license (wallet items are wallet.financial, software licenses are wallet.computer)
+ else if ([objectType hasPrefix:@"wallet.financial"])
+ {
+ if ([type isEqualToString:@"WalletItem"] || [[theEntry objectForKey:@"LoadingChildren"] boolValue]) {
+ [newObject setObject:title forType:QS1PasswordWalletItem];
+ [newObject setIcon:[[[NSImage alloc] initByReferencingFile:[OnePasswordBundle pathForResource:@"wallet-icon-128" ofType:@"png"]] autorelease]];
+ [objects addObject:newObject];
+ }
+ }
+
+ // else if it's a software license
+ else if ([objectType hasPrefix:@"wallet.computer"])
+ {
+ if ([type isEqualToString:@"SoftwareLicense"] || [[theEntry objectForKey:@"LoadingChildren"] boolValue]) {
+ [newObject setObject:title forType:QS1PasswordSoftwareLicense];
+ [newObject setIcon:[QSResourceManager imageNamed:@"ToolbarAppsFolderIcon"]];
+ [objects addObject:newObject];
+ }
+ }
+
+ // else if it's an online service
+ else if ([objectType hasPrefix:@"wallet.onlineservices"])
+ {
+ if ([type isEqualToString:@"OnlineService"] || [[theEntry objectForKey:@"LoadingChildren"] boolValue]) {
+ [newObject setObject:title forType:QS1PasswordOnlineService];
+ [newObject setIcon:[[[NSImage alloc] initByReferencingFile:[OnePasswordBundle pathForResource:@"logins-icon-128" ofType:@"png"]] autorelease]];
+ [objects addObject:newObject];
+ }
+ }
+
+ // else if it's a secure note
+ else if ([objectType isEqualToString:@"securenotes.SecureNote"])
+ {
+ if ([type isEqualToString:@"SecureNote"] || [[theEntry objectForKey:@"LoadingChildren"] boolValue]) {
+
+ [newObject setObject:title forType:QS1PasswordSecureNote];
+ [newObject setIcon:[[[NSImage alloc] initByReferencingFile:[OnePasswordBundle pathForResource:@"secure-notes-icon-128" ofType:@"png"]]autorelease]];
+ [objects addObject:newObject];
+ }
+ }
+ }
+ }
+ }
+ return [objects autorelease];
}
-
// Object Handler Methods
// An icon that is either already in memory or easy to load
- (void)setQuickIconForObject:(QSObject *)object{
if ([[object primaryType] isEqualToString:@"QS1PasswordForm"])
{
- [object setIcon:onePasswordImage];
+ [object setIcon:[QSResourceManager imageNamed:bundleID]];
}
else if([[object primaryType] isEqualToString:@"QS1PasswordSecureNote"])
{
- [object setIcon:[[[NSImage alloc] initByReferencingFile:[[NSBundle bundleWithIdentifier:bundleID] pathForResource:@"secure-notes-icon-128" ofType:@"png"]]autorelease]];
+ [object setIcon:[QSResourceManager imageNamed:@"secure-notes-icon-128.png" inBundle:[NSBundle bundleWithIdentifier:bundleID]]];
+// [[[NSImage alloc] initByReferencingFile:[[NSBundle bundleWithIdentifier:bundleID] pathForResource:@"secure-notes-icon-128" ofType:@"png"]]autorelease]];
}
else if([[object primaryType] isEqualToString:@"QS1PasswordOnlineService"])
{
- [object setIcon:[[[NSImage alloc] initByReferencingFile:[[NSBundle bundleWithIdentifier:bundleID] pathForResource:@"logins-icon-128" ofType:@"png"]]autorelease]];
+ [object setIcon:[QSResourceManager imageNamed:@"logins-icon-128.png" inBundle:[NSBundle bundleWithIdentifier:bundleID]]];
}
else if([[object primaryType] isEqualToString:@"QS1PasswordWalletItem"])
{
- [object setIcon:[[[NSImage alloc] initByReferencingFile:[[NSBundle bundleWithIdentifier:bundleID] pathForResource:@"wallet-icon-128" ofType:@"png"]]autorelease]];
+ [object setIcon:[QSResourceManager imageNamed:@"wallet-icon-128.png" inBundle:[NSBundle bundleWithIdentifier:bundleID]]];
}
else if([[object primaryType] isEqualToString:@"QS1PasswordIdentity"])
{

0 comments on commit 008b0c7

Please sign in to comment.