Revision: 4133
          http://skim-app.svn.sourceforge.net/skim-app/?rev=4133&view=rev
Author:   hofman
Date:     2008-07-05 06:33:08 -0700 (Sat, 05 Jul 2008)

Log Message:
-----------
Return all EAs as a dictionary rather than an error.

Modified Paths:
--------------
    trunk/SkimNotes/SKNExtendedAttributeManager.h
    trunk/SkimNotes/SKNExtendedAttributeManager.m

Modified: trunk/SkimNotes/SKNExtendedAttributeManager.h
===================================================================
--- trunk/SkimNotes/SKNExtendedAttributeManager.h       2008-07-05 13:17:04 UTC 
(rev 4132)
+++ trunk/SkimNotes/SKNExtendedAttributeManager.h       2008-07-05 13:33:08 UTC 
(rev 4133)
@@ -126,9 +126,9 @@
     @param      path Path to the object in the file system.
     @param      follow Follow symlinks (<code>getxattr(2)</code> does this by 
default, so typically you should pass <code>YES</code>).
     @param      error Error object describing the error if <code>nil</code> 
was returned.
-    @result     Array of data objects or <code>nil</code> if an error occurred.
+    @result     Dictionary of data objects as values and strings as key, or 
<code>nil</code> if an error occurred.
 */
-- (NSArray *)allExtendedAttributesAtPath:(NSString *)path 
traverseLink:(BOOL)follow error:(NSError **)error;
+- (NSDictionary *)allExtendedAttributesAtPath:(NSString *)path 
traverseLink:(BOOL)follow error:(NSError **)error;
 
 /*!
     @method     
propertyListFromExtendedAttributeNamed:atPath:traverseLink:error:

Modified: trunk/SkimNotes/SKNExtendedAttributeManager.m
===================================================================
--- trunk/SkimNotes/SKNExtendedAttributeManager.m       2008-07-05 13:17:04 UTC 
(rev 4132)
+++ trunk/SkimNotes/SKNExtendedAttributeManager.m       2008-07-05 13:33:08 UTC 
(rev 4133)
@@ -166,7 +166,7 @@
     return attrs;
 }
 
-- (NSArray *)allExtendedAttributesAtPath:(NSString *)path 
traverseLink:(BOOL)follow error:(NSError **)error;
+- (NSDictionary *)allExtendedAttributesAtPath:(NSString *)path 
traverseLink:(BOOL)follow error:(NSError **)error;
 {
     NSError *anError = nil;
     NSArray *attrNames = [self extendedAttributeNamesAtPath:path 
traverseLink:follow error:&anError];
@@ -176,14 +176,14 @@
     }
     
     NSEnumerator *e = [attrNames objectEnumerator];
-    NSMutableArray *attributes = [NSMutableArray arrayWithCapacity:[attrNames 
count]];
+    NSMutableDictionary *attributes = [NSMutableDictionary 
dictionaryWithCapacity:[attrNames count]];
     NSData *data = nil;
     NSString *attrName = nil;
     
     while(attrName = [e nextObject]){
         data = [self extendedAttributeNamed:attrName atPath:path 
traverseLink:follow error:&anError];
         if(data != nil){
-            [attributes addObject:data];
+            [attributes setObject:data forKey:attrName];
         } else {
             if(error) *error = anError;
             return nil;


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to