Revision: 29937
http://sourceforge.net/p/bibdesk/svn/29937
Author: hofman
Date: 2025-12-02 17:41:14 +0000 (Tue, 02 Dec 2025)
Log Message:
-----------
convenience category method to resolve aliases in container of file
Modified Paths:
--------------
trunk/bibdesk/BDSKFiler.m
trunk/bibdesk/NSURL_BDSKExtensions.h
trunk/bibdesk/NSURL_BDSKExtensions.m
Modified: trunk/bibdesk/BDSKFiler.m
===================================================================
--- trunk/bibdesk/BDSKFiler.m 2025-12-02 17:29:03 UTC (rev 29936)
+++ trunk/bibdesk/BDSKFiler.m 2025-12-02 17:41:14 UTC (rev 29937)
@@ -364,10 +364,8 @@
// filemanager needs aliases resolved for moving and existence checks
// ...however we want to move aliases, not their targets
// so we resolve aliases in the path to the containing folder
- resolvedNewURL = [[[newFileURL URLByDeletingLastPathComponent]
fileURLByResolvingAliases]
- URLByAppendingPathComponent:[newFileURL
lastPathComponent] isDirectory:NO];
- resolvedURL = [[[fileURL URLByDeletingLastPathComponent]
fileURLByResolvingAliases]
- URLByAppendingPathComponent:[fileURL
lastPathComponent] isDirectory:NO];
+ resolvedNewURL = [newFileURL fileURLByResolvingAliasesInContainer];
+ resolvedURL = [fileURL fileURLByResolvingAliasesInContainer];
if (resolvedNewURL == nil || resolvedURL == nil) {
status = NSLocalizedString(@"Unable to resolve aliases in path.",
@"AutoFile error message");
statusFlag = BDSKFilerErrorCannotResolveAlias;
Modified: trunk/bibdesk/NSURL_BDSKExtensions.h
===================================================================
--- trunk/bibdesk/NSURL_BDSKExtensions.h 2025-12-02 17:29:03 UTC (rev
29936)
+++ trunk/bibdesk/NSURL_BDSKExtensions.h 2025-12-02 17:41:14 UTC (rev
29937)
@@ -43,6 +43,7 @@
@property (nonatomic, nullable, readonly) NSURL
*fileURLByStrictlyResolvingAliases;
@property (nonatomic, nullable, readonly) NSURL *fileURLByResolvingAliases;
+@property (nonatomic, nullable, readonly) NSURL
*fileURLByResolvingAliasesInContainer;
+ (nullable NSURL *)fileURLWithAliasData:(NSData *)aliasData
bookmarkData:(NSData *)bmData;
+ (nullable NSURL *)fileURLNoUIWithAliasData:(NSData *)aliasData
bookmarkData:(NSData *)bmData;
Modified: trunk/bibdesk/NSURL_BDSKExtensions.m
===================================================================
--- trunk/bibdesk/NSURL_BDSKExtensions.m 2025-12-02 17:29:03 UTC (rev
29936)
+++ trunk/bibdesk/NSURL_BDSKExtensions.m 2025-12-02 17:41:14 UTC (rev
29937)
@@ -154,6 +154,10 @@
return [self fileURLByResolvingAliasesStrictly:NO];
}
+- (NSURL *)fileURLByResolvingAliasesInContainer {
+ return [[[self URLByDeletingLastPathComponent]
fileURLByResolvingAliasesStrictly:NO] URLByAppendingPathComponent:[self
lastPathComponent] isDirectory:NO];
+}
+
+ (NSURL *)fileURLWithAliasData:(NSData *)aliasData bookmarkData:(NSData
*)bmData allowUI:(BOOL)allowUI {
NSURL *fileURL = nil;
if ([bmData length]) {
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