Revision: 4030
http://skim-app.svn.sourceforge.net/skim-app/?rev=4030&view=rev
Author: hofman
Date: 2008-06-19 04:25:46 -0700 (Thu, 19 Jun 2008)
Log Message:
-----------
Add some method documentation, small changes in code to initialize EA manager
Modified Paths:
--------------
trunk/SkimNotes/SKNExtendedAttributeManager.h
trunk/SkimNotes/SKNExtendedAttributeManager.m
Modified: trunk/SkimNotes/SKNExtendedAttributeManager.h
===================================================================
--- trunk/SkimNotes/SKNExtendedAttributeManager.h 2008-06-19 00:14:19 UTC
(rev 4029)
+++ trunk/SkimNotes/SKNExtendedAttributeManager.h 2008-06-19 11:25:46 UTC
(rev 4030)
@@ -53,7 +53,7 @@
/*!
@method sharedManager
- @abstract Returns the shared instance.
+ @abstract Returns the shared instance. You probably always should use
this instance, and is required for Skim notes.
@discussion (comprehensive description)
@result (description)
*/
@@ -62,8 +62,10 @@
/*!
@method initWithPrefix:
@abstract Initializes a new extended attribute manager with keys and
attribute name prefixes used for segments determined by a prefix.
- @discussion The prefix should only contain characters that are valid in
attribute names.
- @param prefix Defaults to "skim-app.sourcesforge.net", which is the
prefix used by Skim.
+ @discussion The prefix is used in splitting large attributes. EA managers
with different prefixes are mutually incompatible,
+ i.e. attributes written with one manager cannot be safely read
by a manager with a different prefix.
+ It is safest to just use the shared instance. The prefix
should only contain characters that are valid in attribute names.
+ @param prefix Defaults to "net_sourceforge_skim-app" for the shared
instance.
@result (description)
*/
- (id)initWithPrefix:(NSString *)prefix;
Modified: trunk/SkimNotes/SKNExtendedAttributeManager.m
===================================================================
--- trunk/SkimNotes/SKNExtendedAttributeManager.m 2008-06-19 00:14:19 UTC
(rev 4029)
+++ trunk/SkimNotes/SKNExtendedAttributeManager.m 2008-06-19 11:25:46 UTC
(rev 4030)
@@ -36,8 +36,9 @@
#define SKNLocalizedString(key, comment) key
#endif
-#define MAX_XATTR_LENGTH 2048
-#define UNIQUE_VALUE [[NSProcessInfo processInfo] globallyUniqueString]
+#define MAX_XATTR_LENGTH 2048
+#define UNIQUE_VALUE [[NSProcessInfo processInfo]
globallyUniqueString]
+#define PREFIX @"net_sourceforge_skim-app"
static NSString *SKNErrorDomain = @"SKNErrorDomain";
@@ -63,16 +64,18 @@
- (id)init;
{
- return [self initWithPrefix:@"net_sourceforge_skim-app"];
+ return [self initWithPrefix:nil];
}
- (id)initWithPrefix:(NSString *)prefix;
{
if (self = [super init]) {
- namePrefix = [[NSString alloc] initWithFormat:@"[EMAIL PROTECTED]",
prefix];
- uniqueKey = [[NSString alloc] initWithFormat:@"[EMAIL PROTECTED]",
prefix];
- wrapperKey = [[NSString alloc] initWithFormat:@"[EMAIL PROTECTED]",
prefix];
- fragmentsKey = [[NSString alloc] initWithFormat:@"[EMAIL PROTECTED]",
prefix];
+ if (prefix == nil)
+ prefix = PREFIX;
+ namePrefix = [[prefix stringByAppendingString:@"_"] retain];
+ uniqueKey = [[prefix stringByAppendingString:@"_key"] retain];
+ wrapperKey = [[prefix stringByAppendingString:@"_has_wrapper"] retain];
+ fragmentsKey = [[prefix
stringByAppendingString:@"_number_of_fragments"] retain];
}
return self;
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit