From 2d5aef6157bef482e03a07d4f62e58c0c5d3263d Mon Sep 17 00:00:00 2001 From: Ross Boucher Date: Thu, 12 Nov 2009 20:37:56 -0800 Subject: [PATCH] Fix for **** type in DocumentController, and an Info.plist bug in bundle tasks. --- AppKit/CPDocumentController.j | 14 ++++++++++---- .../CommonJS/lib/objective-j/jake/bundletask.js | 5 +++++ 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/AppKit/CPDocumentController.j b/AppKit/CPDocumentController.j index 7fffb711b..80f8a373c 100644 --- a/AppKit/CPDocumentController.j +++ b/AppKit/CPDocumentController.j @@ -276,7 +276,8 @@ var CPSharedDocumentController = nil; var index = 0, count = _documentTypes.length, - extension = [[anAbsoluteURL pathExtension] lowercaseString]; + extension = [[anAbsoluteURL pathExtension] lowercaseString], + starType = nil; for (; index < count; ++index) { @@ -286,12 +287,17 @@ var CPSharedDocumentController = nil; extensionCount = extensions.length; for (; extensionIndex < extensionCount; ++extensionIndex) - if ([extensions[extensionIndex] lowercaseString] === extension) + { + var thisExtension = [extensions[extensionIndex] lowercaseString]; + if (thisExtension === extension) return [documentType objectForKey:@"CPBundleTypeName"]; + + if (thisExtension === "****") + starType = [documentType objectForKey:@"CPBundleTypeName"]; + } } - // FIXME? - return [self defaultType];//nil; + return starType || [self defaultType]; } // Managing Document Types diff --git a/Objective-J/CommonJS/lib/objective-j/jake/bundletask.js b/Objective-J/CommonJS/lib/objective-j/jake/bundletask.js index 0d76a9b44..cb1b6147c 100644 --- a/Objective-J/CommonJS/lib/objective-j/jake/bundletask.js +++ b/Objective-J/CommonJS/lib/objective-j/jake/bundletask.js @@ -383,6 +383,11 @@ BundleTask.prototype.defineInfoPlistTask = function() require("objective-j/plist").writePlist(infoPlistProductPath, bundleTask.infoPlist()); }); + var infoPlistPath = this.infoPlistPath(); + + if (infoPlistPath && FILE.exists(infoPlistPath)) + filedir (infoPlistProductPath, [infoPlistPath]); + this.enhance([infoPlistProductPath]); }