Revision: 17935
          http://bibdesk.svn.sourceforge.net/bibdesk/?rev=17935&view=rev
Author:   hofman
Date:     2011-06-04 17:48:21 +0000 (Sat, 04 Jun 2011)

Log Message:
-----------
remove unused methods and rename setters in dictionary category

Modified Paths:
--------------
    trunk/bibdesk/BibDocument.m
    trunk/bibdesk/NSDictionary_BDSKExtensions.h
    trunk/bibdesk/NSDictionary_BDSKExtensions.m

Modified: trunk/bibdesk/BibDocument.m
===================================================================
--- trunk/bibdesk/BibDocument.m 2011-06-04 09:46:23 UTC (rev 17934)
+++ trunk/bibdesk/BibDocument.m 2011-06-04 17:48:21 UTC (rev 17935)
@@ -706,24 +706,24 @@
         [dictionary setObject:[[[tableView tableColumnIdentifiers] 
arrayByRemovingObject:BDSKImportOrderString] 
arrayByRemovingObject:BDSKRelevanceString] forKey:BDSKShownColsNamesKey];
         [dictionary setObject:[self currentTableColumnWidthsAndIdentifiers] 
forKey:BDSKColumnWidthsKey];
         [dictionary setObject:sortKey ?: BDSKTitleString 
forKey:BDSKDefaultSortedTableColumnKey];
-        [dictionary setBoolValue:docFlags.sortDescending 
forKey:BDSKDefaultSortedTableColumnIsDescendingKey];
+        [dictionary setBool:docFlags.sortDescending 
forKey:BDSKDefaultSortedTableColumnIsDescendingKey];
         if (previousSortKey) {
             [dictionary setObject:previousSortKey 
forKey:BDSKDefaultSubsortedTableColumnKey];
-            [dictionary setBoolValue:docFlags.previousSortDescending 
forKey:BDSKDefaultSubsortedTableColumnIsDescendingKey];
+            [dictionary setBool:docFlags.previousSortDescending 
forKey:BDSKDefaultSubsortedTableColumnIsDescendingKey];
         }
         [dictionary setObject:sortGroupsKey forKey:BDSKSortGroupsKey];
-        [dictionary setBoolValue:docFlags.sortGroupsDescending 
forKey:BDSKSortGroupsDescendingKey];
-        [dictionary setRectValue:[documentWindow frame] 
forKey:BDSKDocumentWindowFrameKey];
-        [dictionary setDoubleValue:[groupSplitView fraction] 
forKey:BDSKGroupSplitViewFractionKey];
+        [dictionary setBool:docFlags.sortGroupsDescending 
forKey:BDSKSortGroupsDescendingKey];
+        [dictionary setRect:[documentWindow frame] 
forKey:BDSKDocumentWindowFrameKey];
+        [dictionary setDouble:[groupSplitView fraction] 
forKey:BDSKGroupSplitViewFractionKey];
         // of the 3 splitviews, the fraction of the first divider would be 
considered, so fallback to the fraction from the nib
         if (NO == [self hasWebGroupsSelected])
-            [dictionary setDoubleValue:[splitView fraction] 
forKey:BDSKMainTableSplitViewFractionKey];
-        [dictionary setDoubleValue:docState.lastWebViewFraction 
forKey:BDSKWebViewFractionKey];
+            [dictionary setDouble:[splitView fraction] 
forKey:BDSKMainTableSplitViewFractionKey];
+        [dictionary setDouble:docState.lastWebViewFraction 
forKey:BDSKWebViewFractionKey];
         [dictionary setObject:currentGroupField 
forKey:BDSKCurrentGroupFieldKey];
         
         // we can't just use -documentStringEncoding, because that may be 
different for SaveTo
         if (encoding != BDSKNoStringEncoding)
-            [dictionary setUnsignedIntegerValue:encoding 
forKey:BDSKDocumentStringEncodingKey];
+            [dictionary setUnsignedInteger:encoding 
forKey:BDSKDocumentStringEncodingKey];
         
         // encode groups so we can select them later with isEqual: (saving row 
indexes would not be as reliable)
         [dictionary setObject:([self hasExternalGroupsSelected] ? [NSData 
data] : [NSKeyedArchiver archivedDataWithRootObject:[self selectedGroups]]) 
forKey:BDSKSelectedGroupsKey];
@@ -732,24 +732,24 @@
         if ([selectedKeys count] == 0 || [self hasExternalGroupsSelected])
             selectedKeys = [NSArray array];
         [dictionary setObject:selectedKeys forKey:BDSKSelectedPublicationsKey];
-        [dictionary setPointValue:[tableView scrollPositionAsPercentage] 
forKey:BDSKDocumentScrollPercentageKey];
+        [dictionary setPoint:[tableView scrollPositionAsPercentage] 
forKey:BDSKDocumentScrollPercentageKey];
         
-        [dictionary setIntegerValue:bottomPreviewDisplay 
forKey:BDSKBottomPreviewDisplayKey];
+        [dictionary setInteger:bottomPreviewDisplay 
forKey:BDSKBottomPreviewDisplayKey];
         [dictionary setObject:bottomPreviewDisplayTemplate 
forKey:BDSKBottomPreviewDisplayTemplateKey];
-        [dictionary setIntegerValue:sidePreviewDisplay 
forKey:BDSKSidePreviewDisplayKey];
+        [dictionary setInteger:sidePreviewDisplay 
forKey:BDSKSidePreviewDisplayKey];
         [dictionary setObject:sidePreviewDisplayTemplate 
forKey:BDSKSidePreviewDisplayTemplateKey];
         
-        [dictionary setIntegerValue:[bottomFileView displayMode] 
forKey:BDSKBottomFileViewDisplayModeKey];
-        [dictionary setDoubleValue:([bottomFileView displayMode] == 
FVDisplayModeGrid ? [bottomFileView iconScale] : 0.0) 
forKey:BDSKBottomFileViewIconScaleKey];
-        [dictionary setIntegerValue:[sideFileView displayMode] 
forKey:BDSKSideFileViewDisplayModeKey];
-        [dictionary setDoubleValue:([sideFileView displayMode] == 
FVDisplayModeGrid ? [sideFileView iconScale] : 0.0) 
forKey:BDSKSideFileViewIconScaleKey];
+        [dictionary setInteger:[bottomFileView displayMode] 
forKey:BDSKBottomFileViewDisplayModeKey];
+        [dictionary setDouble:([bottomFileView displayMode] == 
FVDisplayModeGrid ? [bottomFileView iconScale] : 0.0) 
forKey:BDSKBottomFileViewIconScaleKey];
+        [dictionary setInteger:[sideFileView displayMode] 
forKey:BDSKSideFileViewDisplayModeKey];
+        [dictionary setDouble:([sideFileView displayMode] == FVDisplayModeGrid 
? [sideFileView iconScale] : 0.0) forKey:BDSKSideFileViewIconScaleKey];
         
-        [dictionary setDoubleValue:[(BDSKZoomableTextView 
*)bottomPreviewTextView scaleFactor] forKey:BDSKBottomPreviewScaleFactorKey];
-        [dictionary setDoubleValue:[(BDSKZoomableTextView 
*)sidePreviewTextView scaleFactor] forKey:BDSKSidePreviewScaleFactorKey];
+        [dictionary setDouble:[(BDSKZoomableTextView *)bottomPreviewTextView 
scaleFactor] forKey:BDSKBottomPreviewScaleFactorKey];
+        [dictionary setDouble:[(BDSKZoomableTextView *)sidePreviewTextView 
scaleFactor] forKey:BDSKSidePreviewScaleFactorKey];
         
         if(previewer){
-            [dictionary setDoubleValue:[previewer PDFScaleFactor] 
forKey:BDSKPreviewPDFScaleFactorKey];
-            [dictionary setDoubleValue:[previewer RTFScaleFactor] 
forKey:BDSKPreviewRTFScaleFactorKey];
+            [dictionary setDouble:[previewer PDFScaleFactor] 
forKey:BDSKPreviewPDFScaleFactorKey];
+            [dictionary setDouble:[previewer RTFScaleFactor] 
forKey:BDSKPreviewRTFScaleFactorKey];
         }
         
         if(fileSearchController){

Modified: trunk/bibdesk/NSDictionary_BDSKExtensions.h
===================================================================
--- trunk/bibdesk/NSDictionary_BDSKExtensions.h 2011-06-04 09:46:23 UTC (rev 
17934)
+++ trunk/bibdesk/NSDictionary_BDSKExtensions.h 2011-06-04 17:48:21 UTC (rev 
17935)
@@ -74,10 +74,8 @@
 - (BOOL)boolForKey:(NSString *)key defaultValue:(BOOL)defaultValue;
 - (NSInteger)integerForKey:(NSString *)key 
defaultValue:(NSInteger)defaultValue;
 - (NSUInteger)unsignedIntegerForKey:(NSString *)key 
defaultValue:(NSUInteger)defaultValue;
-- (float)floatForKey:(NSString *)key defaultValue:(float)defaultValue;
 - (double)doubleForKey:(NSString *)key defaultValue:(double)defaultValue;
 - (NSPoint)pointForKey:(NSString *)key defaultValue:(NSPoint)defaultValue;
-- (NSSize)sizeForKey:(NSString *)key defaultValue:(NSSize)defaultValue;
 - (NSRect)rectForKey:(NSString *)key defaultValue:(NSRect)defaultValue;
 
 @end
@@ -88,13 +86,11 @@
 
 - (id)initForCaseInsensitiveKeys;
 
-- (void)setBoolValue:(BOOL)value forKey:(NSString *)key;
-- (void)setIntegerValue:(NSInteger)value forKey:(NSString *)key;
-- (void)setUnsignedIntegerValue:(NSUInteger)value forKey:(NSString *)key;
-- (void)setFloatValue:(float)value forKey:(NSString *)key;
-- (void)setDoubleValue:(double)value forKey:(NSString *)key;
-- (void)setPointValue:(NSPoint)value forKey:(NSString *)key;
-- (void)setSizeValue:(NSSize)value forKey:(NSString *)key;
-- (void)setRectValue:(NSRect)value forKey:(NSString *)key;
+- (void)setBool:(BOOL)value forKey:(NSString *)key;
+- (void)setInteger:(NSInteger)value forKey:(NSString *)key;
+- (void)setUnsignedInteger:(NSUInteger)value forKey:(NSString *)key;
+- (void)setDouble:(double)value forKey:(NSString *)key;
+- (void)setPoint:(NSPoint)value forKey:(NSString *)key;
+- (void)setRect:(NSRect)value forKey:(NSString *)key;
 
 @end

Modified: trunk/bibdesk/NSDictionary_BDSKExtensions.m
===================================================================
--- trunk/bibdesk/NSDictionary_BDSKExtensions.m 2011-06-04 09:46:23 UTC (rev 
17934)
+++ trunk/bibdesk/NSDictionary_BDSKExtensions.m 2011-06-04 17:48:21 UTC (rev 
17935)
@@ -109,11 +109,6 @@
     return [value respondsToSelector:@selector(unsignedIntegerValue)] ? [value 
unsignedIntegerValue] : [value respondsToSelector:@selector(integerValue)] ? 
(NSUInteger)[value integerValue] : defaultValue;
 }
 
-- (float)floatForKey:(NSString *)key defaultValue:(float)defaultValue {
-    id value = [self objectForKey:key];
-    return [value respondsToSelector:@selector(floatValue)] ? [value 
floatValue] : defaultValue;
-}
-
 - (double)doubleForKey:(NSString *)key defaultValue:(double)defaultValue {
     id value = [self objectForKey:key];
     return [value respondsToSelector:@selector(doubleValue)] ? [value 
doubleValue] : defaultValue;
@@ -129,16 +124,6 @@
         return defaultValue;
 }
 
-- (NSSize)sizeForKey:(NSString *)key defaultValue:(NSSize)defaultValue {
-    id value = [self objectForKey:key];
-    if ([value respondsToSelector:@selector(sizeValue)])
-        return [value sizeValue];
-    else if ([value isKindOfClass:[NSString class]] && NO == [NSString 
isEmptyString:value])
-        return NSSizeFromString(value);
-    else
-        return defaultValue;
-}
-
 - (NSRect)rectForKey:(NSString *)key defaultValue:(NSRect)defaultValue {
     id value = [self objectForKey:key];
     if ([value respondsToSelector:@selector(rectValue)])
@@ -162,45 +147,35 @@
 
 // The rest of these methods are copied from NSMutableData-OFExtensions.m
 
-- (void)setBoolValue:(BOOL)value forKey:(NSString *)key {
+- (void)setBool:(BOOL)value forKey:(NSString *)key {
     NSNumber *number = [[NSNumber alloc] initWithBool:value];
     [self setObject:number forKey:key];
     [number release];
 }
 
-- (void)setIntegerValue:(NSInteger)value forKey:(NSString *)key {
+- (void)setInteger:(NSInteger)value forKey:(NSString *)key {
     NSNumber *number = [[NSNumber alloc] initWithInteger:value];
     [self setObject:number forKey:key];
     [number release];
 }
 
-- (void)setUnsignedIntegerValue:(NSUInteger)value forKey:(NSString *)key {
+- (void)setUnsignedInteger:(NSUInteger)value forKey:(NSString *)key {
     NSNumber *number = [[NSNumber alloc] initWithUnsignedInteger:value];
     [self setObject:number forKey:key];
     [number release];
 }
 
-- (void)setFloatValue:(float)value forKey:(NSString *)key {
-    NSNumber *number = [[NSNumber alloc] initWithFloat:value];
-    [self setObject:number forKey:key];
-    [number release];
-}
-
-- (void)setDoubleValue:(double)value forKey:(NSString *)key {
+- (void)setDouble:(double)value forKey:(NSString *)key {
     NSNumber *number = [[NSNumber alloc] initWithDouble:value];
     [self setObject:number forKey:key];
     [number release];
 }
 
-- (void)setPointValue:(NSPoint)value forKey:(NSString *)key {
+- (void)setPoint:(NSPoint)value forKey:(NSString *)key {
     [self setObject:NSStringFromPoint(value) forKey:key];
 }
 
-- (void)setSizeValue:(NSSize)value forKey:(NSString *)key {
-    [self setObject:NSStringFromSize(value) forKey:key];
-}
-
-- (void)setRectValue:(NSRect)value forKey:(NSString *)key {
+- (void)setRect:(NSRect)value forKey:(NSString *)key {
     [self setObject:NSStringFromRect(value) forKey:key];
 }
 


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

------------------------------------------------------------------------------
Simplify data backup and recovery for your virtual environment with vRanger.
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Discover what all the cheering's about.
Get your free trial download today. 
http://p.sf.net/sfu/quest-dev2dev2 
_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to