Fix command-line tool installer initialization

This commit is contained in:
1024jp 2015-08-25 14:32:37 +09:00
parent 6f33f33014
commit 4dbd839b28
4 changed files with 15 additions and 21 deletions

View File

@ -23,7 +23,8 @@ develop
### Fixes
- [beta] Fix an issue the strings that were inserted via script or tools could be styled wrong.
- Fix an issue where the command-line tool could rarely not be installed from Integration pane.
- [beta] Fix an issue where the strings that were inserted via script or tools could be styled wrong.

View File

@ -117,6 +117,7 @@
<li>Fix an issue where the full path display in the document inspector did not update after the document file moved.</li>
<li>Fix an issue where the find panel could not find matched strings when the find string includes CR or CR/LF line endings.</li>
<li>Fix an issue where line numbers were not drawn completely on OS X 10.8 when scroll bars are set as always shown.</li>
<li>Fix an issue where the command-line tool could rarely not be installed from Integration pane.</li>
<li>Fix an issue where some legatured characters were drawn at a wrong position when the line height for composite font is fixed.</li>
<li>Improve general stability.</li>
</ul>

View File

@ -115,6 +115,7 @@
<li>書類ファイルが移動されたときに書類情報のフルパス表示が更新されなかった不具合を修正</li>
<li>検索文字列に CR および CR/LF の改行コードが含まれるとき検索ができなかった不具合を修正</li>
<li>OS X 10.8 で、スクロールバーを常に表示する設定にしているときに行番号表示が乱れることがあった不具合を修正</li>
<li>連携ペインでのコマンドラインツールのインストールが稀にできないことがあった不具合を修正</li>
<li>行高を固定しているとき、リガチャ文字が誤った場所に描画されることがあった不具合を修正</li>
<li>全般的な安定性を向上</li>
</ul>

View File

@ -35,6 +35,7 @@ static NSString *const kSymbolicLinkPath = @"/usr/local/bin/cot";
@interface CEIntegrationPaneController ()
@property (nonatomic, nonnull) NSURL *preferredLinkTargetURL;
@property (nonatomic, nonnull) NSURL *linkURL;
@property (nonatomic, nonnull) NSURL *executableURL;
@property (nonatomic, getter=isUninstallable) BOOL uninstallable;
@ -52,27 +53,8 @@ static NSString *const kSymbolicLinkPath = @"/usr/local/bin/cot";
@implementation CEIntegrationPaneController
static const NSURL *kPreferredLinkTargetURL;
#pragma mark Superclass Methods
// ------------------------------------------------------
/// initialize class
+ (void)initialize
// ------------------------------------------------------
{
NSString *appName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleName"];
NSURL *applicationDirURL = [[NSFileManager defaultManager] URLForDirectory:NSApplicationDirectory
inDomain:NSLocalDomainMask
appropriateForURL:nil
create:NO
error:nil];
kPreferredLinkTargetURL = [[[applicationDirURL URLByAppendingPathComponent:appName] URLByAppendingPathExtension:@"app"]
URLByAppendingPathComponent:@"Contents/MacOS/cot"];
}
// ------------------------------------------------------
/// initialize instance
- (nullable instancetype)initWithNibName:(nullable NSString *)nibNameOrNil bundle:(nullable NSBundle *)nibBundleOrNil
@ -80,6 +62,15 @@ static const NSURL *kPreferredLinkTargetURL;
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
NSString *appName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleName"];
NSURL *applicationDirURL = [[NSFileManager defaultManager] URLForDirectory:NSApplicationDirectory
inDomain:NSLocalDomainMask
appropriateForURL:nil
create:NO
error:nil];
_preferredLinkTargetURL = [[[applicationDirURL URLByAppendingPathComponent:appName] URLByAppendingPathExtension:@"app"]
URLByAppendingPathComponent:@"Contents/MacOS/cot"];
_linkURL = [NSURL fileURLWithPath:kSymbolicLinkPath];
_executableURL = [[NSBundle mainBundle] URLForAuxiliaryExecutable:@"cot"];
_uninstallable = YES;
@ -257,7 +248,7 @@ static const NSURL *kPreferredLinkTargetURL;
}
if ([linkDestinationURL isEqual:[[self executableURL] URLByStandardizingPath]] ||
[linkDestinationURL isEqual:kPreferredLinkTargetURL]) // link to '/Applications/CotEditor.app' is always valid
[linkDestinationURL isEqual:[self preferredLinkTargetURL]]) // link to '/Applications/CotEditor.app' is always valid
{
// totaly valid link
return YES;