[Keychain-commit] SF.net SVN: keychain:[463] trunk/Frameworks/Keychain/Keychain/KeychainItem. m
Status: Abandoned
Brought to you by:
wadetregaskis
|
From: <wad...@us...> - 2009-01-13 07:23:47
|
Revision: 463
http://keychain.svn.sourceforge.net/keychain/?rev=463&view=rev
Author: wadetregaskis
Date: 2009-01-13 07:23:41 +0000 (Tue, 13 Jan 2009)
Log Message:
-----------
* Now determine the port only for internet items, rather than all KeychainItems (was causing annoying error messages for those items that don't have port attributes).
* The description for generic passwords now displays the service, rather than trying to display the server, port and path, none of which apply for generic passwords.
Credit to Nathan Kinsinger for identifying and fixing these issues.
Modified Paths:
--------------
trunk/Frameworks/Keychain/Keychain/KeychainItem.m
Modified: trunk/Frameworks/Keychain/Keychain/KeychainItem.m
===================================================================
--- trunk/Frameworks/Keychain/Keychain/KeychainItem.m 2009-01-08 07:36:03 UTC (rev 462)
+++ trunk/Frameworks/Keychain/Keychain/KeychainItem.m 2009-01-13 07:23:41 UTC (rev 463)
@@ -1125,9 +1125,8 @@
}
- (NSString*)description {
- Certificate *cert;
- NSString *label, *account, *protocol, *server, *path, *comment, *typeDescription;
- uint32_t port = [self port];
+ Certificate *cert = nil;
+ NSString *label = nil, *account = nil, *protocol = nil, *server = nil, *service = nil, *path = nil, *comment = nil, *typeDescription = nil;
NSMutableString *result = [[NSMutableString alloc] initWithCapacity:50];
switch ([self kind]) {
@@ -1157,7 +1156,9 @@
if (server) {
[result appendString:server];
-
+
+ uint32_t port = [self port];
+
if (port != 0) {
[result appendString:[NSString stringWithFormat:@":%"PRIu32, port]];
}
@@ -1180,7 +1181,7 @@
break;
//return [NSString stringWithFormat:@"%@: %@ @ %@://%@:%d/%@ (%@)", [self label], [self account], [self protocolString], [self server], (int)[self port], [self path], [self comment]]; break;
- case kSecGenericPasswordItemClass: // <label>: <account> @ [<typeDescription>] <server>:<port>/<path> (<comment>)
+ case kSecGenericPasswordItemClass: // <label>: <account> @ [<typeDescription>] <service> (<comment>)
label = [self label];
if (label) {
@@ -1202,23 +1203,12 @@
[result appendString:@" "];
}
- server = [self server];
+ service = [self service];
- if (server) {
- [result appendString:server];
-
- if (port != 0) {
- [result appendString:[NSString stringWithFormat:@":%"PRIu32, port]];
- }
+ if (service) {
+ [result appendString:service];
}
- path = [self path];
-
- if (path) {
- [result appendString:@"/"];
- [result appendString:path];
- }
-
comment = [self comment];
if (comment) {
@@ -1229,7 +1219,7 @@
break;
- //return [NSString stringWithFormat:@"%@: %@ @ [%@] %@:%d (%@)", [self label], [self account], [self typeDescription], [self server], (int)[self port], [self comment]]; break;
+ //return [NSString stringWithFormat:@"%@: %@ @ [%@] %@ (%@)", [self label], [self account], [self typeDescription], [self service], [self comment]]; break;
case kSecAppleSharePasswordItemClass: // <label>: <account> @ <protocol>://<server> (<comment>)
label = [self label];
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|