Revision: 27584
          http://sourceforge.net/p/bibdesk/svn/27584
Author:   hofman
Date:     2022-06-08 19:20:48 +0000 (Wed, 08 Jun 2022)
Log Message:
-----------
rename files for table sort descriptor

Modified Paths:
--------------
    trunk/bibdesk/Bibdesk.xcodeproj/project.pbxproj

Added Paths:
-----------
    trunk/bibdesk/NSSortDescriptor_BDSKExtensions.h
    trunk/bibdesk/NSSortDescriptor_BDSKExtensions.m

Removed Paths:
-------------
    trunk/bibdesk/BDSKTableSortDescriptor.h
    trunk/bibdesk/BDSKTableSortDescriptor.m

Deleted: trunk/bibdesk/BDSKTableSortDescriptor.h
===================================================================
--- trunk/bibdesk/BDSKTableSortDescriptor.h     2022-06-08 19:17:07 UTC (rev 
27583)
+++ trunk/bibdesk/BDSKTableSortDescriptor.h     2022-06-08 19:20:48 UTC (rev 
27584)
@@ -1,44 +0,0 @@
-//
-//  BDSKTableSortDescriptor.h
-//  Bibdesk
-//
-//  Created by Christiaan Hofman on 12/11/05.
-/*
- This software is Copyright (c) 2005-2022
- Christiaan Hofman. All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
-
- - Redistributions of source code must retain the above copyright
-   notice, this list of conditions and the following disclaimer.
-
- - Redistributions in binary form must reproduce the above copyright
-    notice, this list of conditions and the following disclaimer in
-    the documentation and/or other materials provided with the
-    distribution.
-
- - Neither the name of Christiaan Hofman nor the names of any
-    contributors may be used to endorse or promote products derived
-    from this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#import <Foundation/Foundation.h>
-
-
-@interface BDSKTableSortDescriptor : NSSortDescriptor
-+ (BDSKTableSortDescriptor *)tableSortDescriptorForIdentifier:(NSString *)tcID 
ascending:(BOOL)ascend;
-@end

Deleted: trunk/bibdesk/BDSKTableSortDescriptor.m
===================================================================
--- trunk/bibdesk/BDSKTableSortDescriptor.m     2022-06-08 19:17:07 UTC (rev 
27583)
+++ trunk/bibdesk/BDSKTableSortDescriptor.m     2022-06-08 19:20:48 UTC (rev 
27584)
@@ -1,176 +0,0 @@
-//
-//  BDSKTableSortDescriptor.m
-//  Bibdesk
-//
-//  Created by Christiaan Hofman on 12/11/05.
-/*
- This software is Copyright (c) 2005-2022
- Christiaan Hofman. All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
-
- - Redistributions of source code must retain the above copyright
-   notice, this list of conditions and the following disclaimer.
-
- - Redistributions in binary form must reproduce the above copyright
-    notice, this list of conditions and the following disclaimer in
-    the documentation and/or other materials provided with the
-    distribution.
-
- - Neither the name of Christiaan Hofman nor the names of any
-    contributors may be used to endorse or promote products derived
-    from this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#import "BDSKTableSortDescriptor.h"
-#import "BDSKTypeManager.h"
-#import "BDSKStringConstants.h"
-#import "NSColor_BDSKExtensions.h"
-#import "BibAuthor.h"
-#import "NSString_BDSKExtensions.h"
-#import "NSURL_BDSKExtensions.h"
-
-
-@implementation BDSKTableSortDescriptor
-
-+ (BDSKTableSortDescriptor *)tableSortDescriptorForIdentifier:(NSString *)tcID 
ascending:(BOOL)ascend{
-
-    NSParameterAssert([NSString isEmptyString:tcID] == NO);
-    
-    BDSKTableSortDescriptor *sortDescriptor = nil;
-    
-       if([tcID isEqualToString:BDSKCiteKeyString]){
-               sortDescriptor = [[self alloc] initWithKey:@"citeKey" 
ascending:ascend selector:@selector(localizedCaseInsensitiveNumericCompare:)];
-        
-       }else if([tcID isEqualToString:BDSKTitleString]){
-               
-               sortDescriptor = [[self alloc] 
initWithKey:@"title.stringByRemovingTeXAndStopWords" ascending:ascend 
selector:@selector(localizedCaseInsensitiveNumericCompare:)];
-               
-       }else if([tcID isEqualToString:BDSKContainerString]){
-               
-        sortDescriptor = [[self alloc] 
initWithKey:@"container.stringByRemovingTeXAndStopWords" ascending:ascend 
selector:@selector(localizedCaseInsensitiveNumericCompare:)];
-        
-       }else if([tcID isEqualToString:BDSKPubDateString]){
-               
-               sortDescriptor = [[self alloc] initWithKey:@"date" 
ascending:ascend selector:@selector(compare:)];              
-        
-       }else if([tcID isEqualToString:BDSKDateAddedString]){
-               
-        sortDescriptor = [[self alloc] initWithKey:@"dateAdded" 
ascending:ascend selector:@selector(compare:)];
-        
-       }else if([tcID isEqualToString:BDSKDateModifiedString]){
-               
-        sortDescriptor = [[self alloc] initWithKey:@"dateModified" 
ascending:ascend selector:@selector(compare:)];
-        
-       }else if([tcID isEqualToString:BDSKAuthorString]){
-        
-        sortDescriptor = [[self alloc] initWithKey:@"pubAuthors" 
ascending:ascend selector:@selector(sortCompareToAuthorArray:)];
-        
-       }else if([tcID isEqualToString:BDSKFirstAuthorString]){
-        
-        sortDescriptor = [[self alloc] initWithKey:@"firstAuthor" 
ascending:ascend selector:@selector(sortCompare:)];
-        
-       }else if([tcID isEqualToString:BDSKSecondAuthorString]){
-               
-        sortDescriptor = [[self alloc] initWithKey:@"secondAuthor" 
ascending:ascend selector:@selector(sortCompare:)];
-               
-       }else if([tcID isEqualToString:BDSKThirdAuthorString]){
-               
-        sortDescriptor = [[self alloc] initWithKey:@"thirdAuthor" 
ascending:ascend selector:@selector(sortCompare:)];
-        
-       }else if([tcID isEqualToString:BDSKLastAuthorString]){
-               
-        sortDescriptor = [[self alloc] initWithKey:@"lastAuthor" 
ascending:ascend selector:@selector(sortCompare:)];
-        
-       }else if([tcID isEqualToString:BDSKAuthorEditorString]){
-        
-        sortDescriptor = [[self alloc] initWithKey:@"pubAuthorsOrEditors" 
ascending:ascend selector:@selector(sortCompareToAuthorArray:)];
-        
-       }else if([tcID isEqualToString:BDSKFirstAuthorEditorString]){
-        
-        sortDescriptor = [[self alloc] initWithKey:@"firstAuthorOrEditor" 
ascending:ascend selector:@selector(sortCompare:)];
-        
-       }else if([tcID isEqualToString:BDSKSecondAuthorEditorString]){
-               
-        sortDescriptor = [[self alloc] initWithKey:@"secondAuthorOrEditor" 
ascending:ascend selector:@selector(sortCompare:)];
-               
-       }else if([tcID isEqualToString:BDSKThirdAuthorEditorString]){
-               
-        sortDescriptor = [[self alloc] initWithKey:@"thirdAuthorOrEditor" 
ascending:ascend selector:@selector(sortCompare:)];
-        
-       }else if([tcID isEqualToString:BDSKLastAuthorEditorString]){
-               
-        sortDescriptor = [[self alloc] initWithKey:@"lastAuthorOrEditor" 
ascending:ascend selector:@selector(sortCompare:)];
-        
-       }else if([tcID isEqualToString:BDSKEditorString]){
-               
-        sortDescriptor = [[self alloc] initWithKey:@"pubEditors.@firstObject" 
ascending:ascend selector:@selector(sortCompare:)];
-
-       }else if([tcID isEqualToString:BDSKPubTypeString]){
-
-        sortDescriptor = [[self alloc] initWithKey:@"pubType" ascending:ascend 
selector:@selector(caseInsensitiveCompare:)];
-        
-    }else if([tcID isEqualToString:BDSKItemNumberString] || [tcID 
isEqualToString:BDSKImportOrderString]){
-        
-        sortDescriptor = [[self alloc] initWithKey:@"fileOrder" 
ascending:ascend selector:@selector(compare:)];                
-        
-    }else if([tcID isEqualToString:BDSKBooktitleString]){
-        
-        sortDescriptor = [[self alloc] 
initWithKey:@"Booktitle.stringByRemovingTeXAndStopWords" ascending:ascend 
selector:@selector(localizedCaseInsensitiveNumericCompare:)];
-        
-    }else if([tcID isBooleanField] || [tcID isTriStateField]){
-        
-        sortDescriptor = [[self alloc] initWithKey:tcID ascending:ascend 
selector:@selector(triStateCompare:)];
-        
-    }else if([tcID isRatingField] || [tcID 
isEqualToString:BDSKRelevanceString] || [tcID isNumericField]){
-        
-        sortDescriptor = [[self alloc] initWithKey:tcID ascending:ascend 
selector:@selector(numericCompare:)];
-        
-    }else if([tcID isRemoteURLField]){
-        
-        // compare pathExtension for URL fields so the subsort is more useful
-        sortDescriptor = [[self alloc] initWithKey:tcID ascending:ascend 
selector:@selector(extensionCompare:)];
-
-    }else if([tcID isLocalFileField]){
-        
-        // compare UTI for file fields so the subsort is more useful
-        sortDescriptor = [[self alloc] initWithKey:[NSString 
stringWithFormat:@"URLFields.%@", tcID] ascending:ascend 
selector:@selector(UTICompare:)];
-        
-    }else if([tcID isEqualToString:BDSKLocalFileString]){
-        
-        sortDescriptor = [[self alloc] 
initWithKey:@"countOfLocalFilesAsNumber" ascending:ascend 
selector:@selector(compare:)];
-        
-    }else if([tcID isEqualToString:BDSKRemoteURLString]){
-        
-        sortDescriptor = [[self alloc] 
initWithKey:@"countOfRemoteURLsAsNumber" ascending:ascend 
selector:@selector(compare:)];
-        
-    }else if([tcID isEqualToString:BDSKColorString] || [tcID 
isEqualToString:BDSKColorLabelString]){
-        
-        sortDescriptor = [[self alloc] initWithKey:@"color" ascending:ascend 
selector:@selector(colorCompare:)];
-        
-    }else {
-        
-        // this assumes that all other columns must be NSString objects
-        sortDescriptor = [[self alloc] initWithKey:tcID ascending:ascend 
selector:@selector(localizedCaseInsensitiveNumericCompare:)];
-        
-       }
- 
-    BDSKASSERT(sortDescriptor);
-    return [sortDescriptor autorelease];
-}
-
-@end

Modified: trunk/bibdesk/Bibdesk.xcodeproj/project.pbxproj
===================================================================
--- trunk/bibdesk/Bibdesk.xcodeproj/project.pbxproj     2022-06-08 19:17:07 UTC 
(rev 27583)
+++ trunk/bibdesk/Bibdesk.xcodeproj/project.pbxproj     2022-06-08 19:20:48 UTC 
(rev 27584)
@@ -326,7 +326,7 @@
                CE2A0A7E22459A3100A8F31C /* BDSKStringEncodingManager.h in 
Headers */ = {isa = PBXBuildFile; fileRef = F9F78CD207D5320D004B68AF /* 
BDSKStringEncodingManager.h */; };
                CE2A0A7F22459A3100A8F31C /* BDSKStringNode.h in Headers */ = 
{isa = PBXBuildFile; fileRef = F9025DA90969AB69008A551C /* BDSKStringNode.h */; 
};
                CE2A0A8022459A3100A8F31C /* BDSKStringParser.h in Headers */ = 
{isa = PBXBuildFile; fileRef = F9E6C5970999323D00A8B97D /* BDSKStringParser.h 
*/; };
-               CE2A0A8122459A3100A8F31C /* BDSKTableSortDescriptor.h in 
Headers */ = {isa = PBXBuildFile; fileRef = CEF94412092668EA00750FFA /* 
BDSKTableSortDescriptor.h */; };
+               CE2A0A8122459A3100A8F31C /* NSSortDescriptor_BDSKExtensions.h 
in Headers */ = {isa = PBXBuildFile; fileRef = CEF94412092668EA00750FFA /* 
NSSortDescriptor_BDSKExtensions.h */; };
                CE2A0A8222459A3100A8F31C /* BDSKTableView.h in Headers */ = 
{isa = PBXBuildFile; fileRef = CE62E0B70F4C4A2100BDF01E /* BDSKTableView.h */; 
};
                CE2A0A8322459A3100A8F31C /* BDSKTask.h in Headers */ = {isa = 
PBXBuildFile; fileRef = F9C50D880EA3A2D6009FE098 /* BDSKTask.h */; };
                CE2A0A8422459A3100A8F31C /* BDSKTemplate.h in Headers */ = {isa 
= PBXBuildFile; fileRef = F98DB3150A23C7730040D347 /* BDSKTemplate.h */; };
@@ -768,7 +768,7 @@
                CEF83F380C77911F00A3AD51 /* BDSKBookmarkController.m in Sources 
*/ = {isa = PBXBuildFile; fileRef = CEF83F360C77911F00A3AD51 /* 
BDSKBookmarkController.m */; };
                CEF8F8DF0F93519700948A88 /* WebGroupStartPage.html in Resources 
*/ = {isa = PBXBuildFile; fileRef = CEF8F8DD0F93519700948A88 /* 
WebGroupStartPage.html */; };
                CEF942120926458C00750FFA /* BDSKPathColorTransformer.m in 
Sources */ = {isa = PBXBuildFile; fileRef = CEF942100926458C00750FFA /* 
BDSKPathColorTransformer.m */; };
-               CEF94415092668EA00750FFA /* BDSKTableSortDescriptor.m in 
Sources */ = {isa = PBXBuildFile; fileRef = CEF94413092668EA00750FFA /* 
BDSKTableSortDescriptor.m */; };
+               CEF94415092668EA00750FFA /* NSSortDescriptor_BDSKExtensions.m 
in Sources */ = {isa = PBXBuildFile; fileRef = CEF94413092668EA00750FFA /* 
NSSortDescriptor_BDSKExtensions.m */; };
                CEF9C0DD2172A357003EC426 /* BDSKBookmark+Scripting.m in Sources 
*/ = {isa = PBXBuildFile; fileRef = CEF9C0DB2172A357003EC426 /* 
BDSKBookmark+Scripting.m */; };
                CEF9C0ED2172A378003EC426 /* BDSKSearchBookmark+Scripting.m in 
Sources */ = {isa = PBXBuildFile; fileRef = CEF9C0EB2172A378003EC426 /* 
BDSKSearchBookmark+Scripting.m */; };
                CEFA07F50AF0E52100A3B4B1 /* BDSKApplication.m in Sources */ = 
{isa = PBXBuildFile; fileRef = CEFA07F30AF0E52100A3B4B1 /* BDSKApplication.m 
*/; };
@@ -1984,8 +1984,8 @@
                CEF8F8E00F9351A600948A88 /* fr */ = {isa = PBXFileReference; 
fileEncoding = 4; lastKnownFileType = text.html; name = fr; path = 
fr.lproj/WebGroupStartPage.html; sourceTree = "<group>"; };
                CEF9420F0926458C00750FFA /* BDSKPathColorTransformer.h */ = 
{isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; 
path = BDSKPathColorTransformer.h; sourceTree = "<group>"; };
                CEF942100926458C00750FFA /* BDSKPathColorTransformer.m */ = 
{isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = 
sourcecode.c.objc; path = BDSKPathColorTransformer.m; sourceTree = "<group>"; };
-               CEF94412092668EA00750FFA /* BDSKTableSortDescriptor.h */ = {isa 
= PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path 
= BDSKTableSortDescriptor.h; sourceTree = "<group>"; };
-               CEF94413092668EA00750FFA /* BDSKTableSortDescriptor.m */ = {isa 
= PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; 
path = BDSKTableSortDescriptor.m; sourceTree = "<group>"; };
+               CEF94412092668EA00750FFA /* NSSortDescriptor_BDSKExtensions.h 
*/ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = 
sourcecode.c.h; path = NSSortDescriptor_BDSKExtensions.h; sourceTree = 
"<group>"; };
+               CEF94413092668EA00750FFA /* NSSortDescriptor_BDSKExtensions.m 
*/ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = 
sourcecode.c.objc; path = NSSortDescriptor_BDSKExtensions.m; sourceTree = 
"<group>"; };
                CEF9C0DA2172A357003EC426 /* BDSKBookmark+Scripting.h */ = {isa 
= PBXFileReference; lastKnownFileType = sourcecode.c.h; path = 
"BDSKBookmark+Scripting.h"; sourceTree = "<group>"; };
                CEF9C0DB2172A357003EC426 /* BDSKBookmark+Scripting.m */ = {isa 
= PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = 
"BDSKBookmark+Scripting.m"; sourceTree = "<group>"; };
                CEF9C0EA2172A378003EC426 /* BDSKSearchBookmark+Scripting.h */ = 
{isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = 
"BDSKSearchBookmark+Scripting.h"; sourceTree = "<group>"; };
@@ -2706,6 +2706,7 @@
                                CEC46E2F1629743200B51A9D /* 
NSPasteboard_BDSKExtensions.m */,
                                CE564D240AECBA5B002F0A24 /* 
NSScanner_BDSKExtensions.m */,
                                CE0D24C7215A84F3001A3F47 /* 
NSScriptCommand_BDSKExtensions.m */,
+                               CEF94413092668EA00750FFA /* 
NSSortDescriptor_BDSKExtensions.m */,
                                F9022C9F0758038000C3F701 /* 
NSString_BDSKExtensions.m */,
                                F9463F4409436F7500CC4549 /* 
NSSet_BDSKExtensions.m */,
                                F9022C5A075802E300C3F701 /* 
NSTask_BDSKExtensions.m */,
@@ -2823,7 +2824,6 @@
                                CEF942100926458C00750FFA /* 
BDSKPathColorTransformer.m */,
                                CEB596C0263C5029000798F9 /* 
BDSKRadioTransformer.m */,
                                CEF5460E0F56BDDB008A630F /* 
BDSKStringArrayFormatter.m */,
-                               CEF94413092668EA00750FFA /* 
BDSKTableSortDescriptor.m */,
                        );
                        name = "Data Handling";
                        sourceTree = "<group>";
@@ -3403,7 +3403,6 @@
                                F9F78CD207D5320D004B68AF /* 
BDSKStringEncodingManager.h */,
                                F9025DA90969AB69008A551C /* BDSKStringNode.h */,
                                F9E6C5970999323D00A8B97D /* BDSKStringParser.h 
*/,
-                               CEF94412092668EA00750FFA /* 
BDSKTableSortDescriptor.h */,
                                CE62E0B70F4C4A2100BDF01E /* BDSKTableView.h */,
                                F9C50D880EA3A2D6009FE098 /* BDSKTask.h */,
                                F98DB3150A23C7730040D347 /* BDSKTemplate.h */,
@@ -3499,6 +3498,7 @@
                                CE564D230AECBA5B002F0A24 /* 
NSScanner_BDSKExtensions.h */,
                                CE0D24C6215A84F3001A3F47 /* 
NSScriptCommand_BDSKExtensions.h */,
                                F9463F4309436F7500CC4549 /* 
NSSet_BDSKExtensions.h */,
+                               CEF94412092668EA00750FFA /* 
NSSortDescriptor_BDSKExtensions.h */,
                                CEE7ACE6109E2F360072D63C /* 
NSSplitView_BDSKExtensions.h */,
                                F9022C9E0758038000C3F701 /* 
NSString_BDSKExtensions.h */,
                                CE969E310931E4F500EE3DFD /* 
NSTableHeaderView_BDSKExtensions.h */,
@@ -3673,7 +3673,7 @@
                                CE2A0A3E224599F600A8F31C /* 
BDSKPathColorTransformer.h in Headers */,
                                CE2A09B72245997A00A8F31C /* BDSKAppController.h 
in Headers */,
                                CE2A0A53224599F600A8F31C /* BDSKRemoveCommand.h 
in Headers */,
-                               CE2A0A8122459A3100A8F31C /* 
BDSKTableSortDescriptor.h in Headers */,
+                               CE2A0A8122459A3100A8F31C /* 
NSSortDescriptor_BDSKExtensions.h in Headers */,
                                CE2A09E9224599DB00A8F31C /* BDSKEditor.h in 
Headers */,
                                CE2A09D9224599B300A8F31C /* 
BDSKConditionController.h in Headers */,
                                CE2A0A51224599F600A8F31C /* 
BDSKReferenceMinerParser.h in Headers */,
@@ -4669,7 +4669,7 @@
                                CE77A7FE0923BEBA0019D901 /* 
NSTableView_BDSKExtensions.m in Sources */,
                                CE20787723EACF7200953DD7 /* 
BDSKMergeController.m in Sources */,
                                CEF942120926458C00750FFA /* 
BDSKPathColorTransformer.m in Sources */,
-                               CEF94415092668EA00750FFA /* 
BDSKTableSortDescriptor.m in Sources */,
+                               CEF94415092668EA00750FFA /* 
NSSortDescriptor_BDSKExtensions.m in Sources */,
                                CE969E340931E4F500EE3DFD /* 
NSTableHeaderView_BDSKExtensions.m in Sources */,
                                CEEC70E2093B6EC200A64F54 /* BDSKDragImageView.m 
in Sources */,
                                F9463F4609436F7500CC4549 /* 
NSSet_BDSKExtensions.m in Sources */,

Copied: trunk/bibdesk/NSSortDescriptor_BDSKExtensions.h (from rev 27583, 
trunk/bibdesk/BDSKTableSortDescriptor.h)
===================================================================
--- trunk/bibdesk/NSSortDescriptor_BDSKExtensions.h                             
(rev 0)
+++ trunk/bibdesk/NSSortDescriptor_BDSKExtensions.h     2022-06-08 19:20:48 UTC 
(rev 27584)
@@ -0,0 +1,44 @@
+//
+//  BDSKTableSortDescriptor.h
+//  Bibdesk
+//
+//  Created by Christiaan Hofman on 12/11/05.
+/*
+ This software is Copyright (c) 2005-2022
+ Christiaan Hofman. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ - Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+
+ - Redistributions in binary form must reproduce the above copyright
+    notice, this list of conditions and the following disclaimer in
+    the documentation and/or other materials provided with the
+    distribution.
+
+ - Neither the name of Christiaan Hofman nor the names of any
+    contributors may be used to endorse or promote products derived
+    from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import <Foundation/Foundation.h>
+
+
+@interface BDSKTableSortDescriptor : NSSortDescriptor
++ (BDSKTableSortDescriptor *)tableSortDescriptorForIdentifier:(NSString *)tcID 
ascending:(BOOL)ascend;
+@end

Copied: trunk/bibdesk/NSSortDescriptor_BDSKExtensions.m (from rev 27583, 
trunk/bibdesk/BDSKTableSortDescriptor.m)
===================================================================
--- trunk/bibdesk/NSSortDescriptor_BDSKExtensions.m                             
(rev 0)
+++ trunk/bibdesk/NSSortDescriptor_BDSKExtensions.m     2022-06-08 19:20:48 UTC 
(rev 27584)
@@ -0,0 +1,176 @@
+//
+//  BDSKTableSortDescriptor.m
+//  Bibdesk
+//
+//  Created by Christiaan Hofman on 12/11/05.
+/*
+ This software is Copyright (c) 2005-2022
+ Christiaan Hofman. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ - Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+
+ - Redistributions in binary form must reproduce the above copyright
+    notice, this list of conditions and the following disclaimer in
+    the documentation and/or other materials provided with the
+    distribution.
+
+ - Neither the name of Christiaan Hofman nor the names of any
+    contributors may be used to endorse or promote products derived
+    from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import "BDSKTableSortDescriptor.h"
+#import "BDSKTypeManager.h"
+#import "BDSKStringConstants.h"
+#import "NSColor_BDSKExtensions.h"
+#import "BibAuthor.h"
+#import "NSString_BDSKExtensions.h"
+#import "NSURL_BDSKExtensions.h"
+
+
+@implementation BDSKTableSortDescriptor
+
++ (BDSKTableSortDescriptor *)tableSortDescriptorForIdentifier:(NSString *)tcID 
ascending:(BOOL)ascend{
+
+    NSParameterAssert([NSString isEmptyString:tcID] == NO);
+    
+    BDSKTableSortDescriptor *sortDescriptor = nil;
+    
+       if([tcID isEqualToString:BDSKCiteKeyString]){
+               sortDescriptor = [[self alloc] initWithKey:@"citeKey" 
ascending:ascend selector:@selector(localizedCaseInsensitiveNumericCompare:)];
+        
+       }else if([tcID isEqualToString:BDSKTitleString]){
+               
+               sortDescriptor = [[self alloc] 
initWithKey:@"title.stringByRemovingTeXAndStopWords" ascending:ascend 
selector:@selector(localizedCaseInsensitiveNumericCompare:)];
+               
+       }else if([tcID isEqualToString:BDSKContainerString]){
+               
+        sortDescriptor = [[self alloc] 
initWithKey:@"container.stringByRemovingTeXAndStopWords" ascending:ascend 
selector:@selector(localizedCaseInsensitiveNumericCompare:)];
+        
+       }else if([tcID isEqualToString:BDSKPubDateString]){
+               
+               sortDescriptor = [[self alloc] initWithKey:@"date" 
ascending:ascend selector:@selector(compare:)];              
+        
+       }else if([tcID isEqualToString:BDSKDateAddedString]){
+               
+        sortDescriptor = [[self alloc] initWithKey:@"dateAdded" 
ascending:ascend selector:@selector(compare:)];
+        
+       }else if([tcID isEqualToString:BDSKDateModifiedString]){
+               
+        sortDescriptor = [[self alloc] initWithKey:@"dateModified" 
ascending:ascend selector:@selector(compare:)];
+        
+       }else if([tcID isEqualToString:BDSKAuthorString]){
+        
+        sortDescriptor = [[self alloc] initWithKey:@"pubAuthors" 
ascending:ascend selector:@selector(sortCompareToAuthorArray:)];
+        
+       }else if([tcID isEqualToString:BDSKFirstAuthorString]){
+        
+        sortDescriptor = [[self alloc] initWithKey:@"firstAuthor" 
ascending:ascend selector:@selector(sortCompare:)];
+        
+       }else if([tcID isEqualToString:BDSKSecondAuthorString]){
+               
+        sortDescriptor = [[self alloc] initWithKey:@"secondAuthor" 
ascending:ascend selector:@selector(sortCompare:)];
+               
+       }else if([tcID isEqualToString:BDSKThirdAuthorString]){
+               
+        sortDescriptor = [[self alloc] initWithKey:@"thirdAuthor" 
ascending:ascend selector:@selector(sortCompare:)];
+        
+       }else if([tcID isEqualToString:BDSKLastAuthorString]){
+               
+        sortDescriptor = [[self alloc] initWithKey:@"lastAuthor" 
ascending:ascend selector:@selector(sortCompare:)];
+        
+       }else if([tcID isEqualToString:BDSKAuthorEditorString]){
+        
+        sortDescriptor = [[self alloc] initWithKey:@"pubAuthorsOrEditors" 
ascending:ascend selector:@selector(sortCompareToAuthorArray:)];
+        
+       }else if([tcID isEqualToString:BDSKFirstAuthorEditorString]){
+        
+        sortDescriptor = [[self alloc] initWithKey:@"firstAuthorOrEditor" 
ascending:ascend selector:@selector(sortCompare:)];
+        
+       }else if([tcID isEqualToString:BDSKSecondAuthorEditorString]){
+               
+        sortDescriptor = [[self alloc] initWithKey:@"secondAuthorOrEditor" 
ascending:ascend selector:@selector(sortCompare:)];
+               
+       }else if([tcID isEqualToString:BDSKThirdAuthorEditorString]){
+               
+        sortDescriptor = [[self alloc] initWithKey:@"thirdAuthorOrEditor" 
ascending:ascend selector:@selector(sortCompare:)];
+        
+       }else if([tcID isEqualToString:BDSKLastAuthorEditorString]){
+               
+        sortDescriptor = [[self alloc] initWithKey:@"lastAuthorOrEditor" 
ascending:ascend selector:@selector(sortCompare:)];
+        
+       }else if([tcID isEqualToString:BDSKEditorString]){
+               
+        sortDescriptor = [[self alloc] initWithKey:@"pubEditors.@firstObject" 
ascending:ascend selector:@selector(sortCompare:)];
+
+       }else if([tcID isEqualToString:BDSKPubTypeString]){
+
+        sortDescriptor = [[self alloc] initWithKey:@"pubType" ascending:ascend 
selector:@selector(caseInsensitiveCompare:)];
+        
+    }else if([tcID isEqualToString:BDSKItemNumberString] || [tcID 
isEqualToString:BDSKImportOrderString]){
+        
+        sortDescriptor = [[self alloc] initWithKey:@"fileOrder" 
ascending:ascend selector:@selector(compare:)];                
+        
+    }else if([tcID isEqualToString:BDSKBooktitleString]){
+        
+        sortDescriptor = [[self alloc] 
initWithKey:@"Booktitle.stringByRemovingTeXAndStopWords" ascending:ascend 
selector:@selector(localizedCaseInsensitiveNumericCompare:)];
+        
+    }else if([tcID isBooleanField] || [tcID isTriStateField]){
+        
+        sortDescriptor = [[self alloc] initWithKey:tcID ascending:ascend 
selector:@selector(triStateCompare:)];
+        
+    }else if([tcID isRatingField] || [tcID 
isEqualToString:BDSKRelevanceString] || [tcID isNumericField]){
+        
+        sortDescriptor = [[self alloc] initWithKey:tcID ascending:ascend 
selector:@selector(numericCompare:)];
+        
+    }else if([tcID isRemoteURLField]){
+        
+        // compare pathExtension for URL fields so the subsort is more useful
+        sortDescriptor = [[self alloc] initWithKey:tcID ascending:ascend 
selector:@selector(extensionCompare:)];
+
+    }else if([tcID isLocalFileField]){
+        
+        // compare UTI for file fields so the subsort is more useful
+        sortDescriptor = [[self alloc] initWithKey:[NSString 
stringWithFormat:@"URLFields.%@", tcID] ascending:ascend 
selector:@selector(UTICompare:)];
+        
+    }else if([tcID isEqualToString:BDSKLocalFileString]){
+        
+        sortDescriptor = [[self alloc] 
initWithKey:@"countOfLocalFilesAsNumber" ascending:ascend 
selector:@selector(compare:)];
+        
+    }else if([tcID isEqualToString:BDSKRemoteURLString]){
+        
+        sortDescriptor = [[self alloc] 
initWithKey:@"countOfRemoteURLsAsNumber" ascending:ascend 
selector:@selector(compare:)];
+        
+    }else if([tcID isEqualToString:BDSKColorString] || [tcID 
isEqualToString:BDSKColorLabelString]){
+        
+        sortDescriptor = [[self alloc] initWithKey:@"color" ascending:ascend 
selector:@selector(colorCompare:)];
+        
+    }else {
+        
+        // this assumes that all other columns must be NSString objects
+        sortDescriptor = [[self alloc] initWithKey:tcID ascending:ascend 
selector:@selector(localizedCaseInsensitiveNumericCompare:)];
+        
+       }
+ 
+    BDSKASSERT(sortDescriptor);
+    return [sortDescriptor autorelease];
+}
+
+@end

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



_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to