• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

BathyScapheのリンクをクリックした時に開くアプリケーションを設定するためのツール


Commit MetaInfo

Révision24b08f19e42dfaa7e15d145ccbe327ad7558077c (tree)
l'heure2012-07-16 22:09:14
Auteurmasakih <masakih@user...>
Commitermasakih

Message de Log

[Mod] プロパティを使用するように変更
[Mod] インスタンス変数にアンスコ付けた

Change Summary

Modification

--- a/BSLinkConductor.m
+++ b/BSLinkConductor.m
@@ -95,9 +95,9 @@ BSLinkConductor* BSLinkC;
9595 NSString *urlString = [imageURL absoluteString];
9696
9797 for(BSLinkConductorItem *item in items) {
98- NSRange range = [urlString rangeOfRegexp:[item regularExpression]];
98+ NSRange range = [urlString rangeOfRegexp:item.regularExpression];
9999 if(range.location != NSNotFound) {
100- if([item isUseLocalCopy]) {
100+ if(item.isUseLocalCopy) {
101101 [urlItemDict setObject:item forKey:imageURL];
102102 [self beginDownloadURL:imageURL];
103103 return YES;
@@ -113,7 +113,7 @@ BSLinkConductor* BSLinkC;
113113 NSString *urlString = [anURL absoluteString];
114114
115115 for(BSLinkConductorItem *item in items) {
116- NSRange range = [urlString rangeOfRegexp:[item regularExpression]];
116+ NSRange range = [urlString rangeOfRegexp:item.regularExpression];
117117 if(range.location != NSNotFound) {
118118 return YES;
119119 }
@@ -189,12 +189,12 @@ BSLinkConductor* BSLinkC;
189189
190190 - (BOOL)isPreviewerItem:(BSLinkConductorItem *)item
191191 {
192- return [[previewSelector previewerDisplayNames] containsObject:[item targetApplicationName]];
192+ return [[previewSelector previewerDisplayNames] containsObject:item.targetApplicationName];
193193 }
194194 - (BOOL)openLink:(NSURL *)anURL withItem:(BSLinkConductorItem *)item;
195195 {
196196 if([self isPreviewerItem:item]) {
197- return [previewSelector openURL:anURL inPreviewerByName:[item targetApplicationName]];
197+ return [previewSelector openURL:anURL inPreviewerByName:item.targetApplicationName];
198198 }
199199
200200 NSWorkspaceLaunchOptions options = 0;
@@ -203,13 +203,13 @@ BSLinkConductor* BSLinkC;
203203 return NO;
204204 }
205205
206- if([item isOpenInBackground]) {
206+ if(item.isOpenInBackground) {
207207 options |= NSWorkspaceLaunchWithoutActivation;
208208 }
209209
210210 NSWorkspace *ws = [NSWorkspace sharedWorkspace];
211211 BOOL result = [ws openURLs:[NSArray arrayWithObject:anURL]
212- withAppBundleIdentifier:[item targetIdentifier]
212+ withAppBundleIdentifier:item.targetIdentifier
213213 options:options
214214 additionalEventParamDescriptor:nil
215215 launchIdentifiers:NULL];
--- a/BSLinkConductorItem.h
+++ b/BSLinkConductorItem.h
@@ -11,14 +11,14 @@
1111
1212 @interface BSLinkConductorItem : NSObject <NSCoding, NSCopying>
1313 {
14- NSString *name;
15- NSString *regularExpression;
16- NSString *targetApplicationName;
14+ NSString *_name;
15+ NSString *_regularExpression;
16+ NSString *_targetApplicationName;
1717
18- BOOL openInBackground;
19- BOOL useLocalCopy;
18+ BOOL _openInBackground;
19+ BOOL _useLocalCopy;
2020
21- NSString *targetIdentifier;
21+ NSString *_targetIdentifier;
2222 }
2323
2424 @property (nonatomic, copy) NSString *name;
--- a/BSLinkConductorItem.m
+++ b/BSLinkConductorItem.m
@@ -22,82 +22,82 @@ static NSString *const BSLCItemUserCopyKey = @"BSLCItemUserCopyKey";
2222
2323 @implementation BSLinkConductorItem
2424
25-@synthesize name, regularExpression, targetApplicationName;
26-@synthesize targetIdentifier;
27-@synthesize openInBackground, useLocalCopy;
25+@synthesize name = _name, regularExpression = _regularExpression, targetApplicationName = _targetApplicationName;
26+@synthesize targetIdentifier = _targetIdentifier;
27+@synthesize openInBackground = _openInBackground, useLocalCopy = _useLocalCopy;
2828
2929 - (id)init
3030 {
3131 if(self = [super init]) {
32- [self setName:[self defaultName]];
33- [self setRegularExpression:@"http://.*"];
34- [self setTargetApplicationName:@""];
35- [self setOpenInBackground:NO];
36- [self setUseLocalCopy:NO];
32+ self.name = [self defaultName];
33+ self.regularExpression = @"http://.*";
34+ self.targetApplicationName = @"";
35+// self.openInBackground = NO;
36+// self.useLocalCopy = NO;
3737 }
3838
3939 return self;
4040 }
4141 - (void)dealloc
4242 {
43- self.name = nil;
44- self.regularExpression = nil;
45- self.targetApplicationName = nil;
46- [targetIdentifier release];
43+ [_name release];
44+ [_regularExpression release];
45+ [_targetApplicationName release];
46+ [_targetIdentifier release];
4747
4848 [super dealloc];
4949 }
5050
5151 - (void)setTargetApplicationName:(NSString *)inAppName
5252 {
53- if([targetApplicationName isEqualToString:inAppName]) return;
53+ if([_targetApplicationName isEqualToString:inAppName]) return;
5454
55- [targetApplicationName autorelease];
56- targetApplicationName = [inAppName copy];
55+ [_targetApplicationName release];
56+ _targetApplicationName = [inAppName copy];
5757
5858 NSWorkspace *ws = [NSWorkspace sharedWorkspace];
59- NSString *fullPath = [ws fullPathForApplication:targetApplicationName];
59+ NSString *fullPath = [ws fullPathForApplication:_targetApplicationName];
6060 if(!fullPath) {
61- targetIdentifier = nil;
61+ _targetIdentifier = nil;
6262 return;
6363 }
6464 NSBundle *bundle = [NSBundle bundleWithPath:fullPath];
6565 if(!bundle) {
66- targetIdentifier = nil;
66+ _targetIdentifier = nil;
6767 return;
6868 }
6969
70- targetIdentifier = [[bundle bundleIdentifier] copy];
70+ _targetIdentifier = [[bundle bundleIdentifier] copy];
7171 }
7272
7373 - (id)copyWithZone:(NSZone *)zone
7474 {
7575 BSLinkConductorItem *result = [[[self class] allocWithZone:zone] init];
76- [result setName:name];
77- [result setRegularExpression:regularExpression];
78- [result setTargetApplicationName:targetApplicationName];
79- [result setOpenInBackground:openInBackground];
80- [result setUseLocalCopy:useLocalCopy];
76+ result.name = self.name;
77+ result.regularExpression = self.regularExpression;
78+ result.targetApplicationName = self.targetApplicationName;
79+ result.openInBackground = self.isOpenInBackground;
80+ result.useLocalCopy = self.isUseLocalCopy;
8181
8282 return result;
8383 }
8484
8585 - (void)encodeWithCoder:(NSCoder *)aCoder
8686 {
87- [aCoder encodeObject:name forKey:BSLCItemNameKey];
88- [aCoder encodeObject:regularExpression forKey:BSLCItemREKey];
89- [aCoder encodeObject:targetApplicationName forKey:BSLCItemAppNameKey];
90- [aCoder encodeBool:openInBackground forKey:BSLCItemOpenBGKey];
91- [aCoder encodeBool:useLocalCopy forKey:BSLCItemUserCopyKey];
87+ [aCoder encodeObject:self.name forKey:BSLCItemNameKey];
88+ [aCoder encodeObject:self.regularExpression forKey:BSLCItemREKey];
89+ [aCoder encodeObject:self.targetApplicationName forKey:BSLCItemAppNameKey];
90+ [aCoder encodeBool:self.isOpenInBackground forKey:BSLCItemOpenBGKey];
91+ [aCoder encodeBool:self.isUseLocalCopy forKey:BSLCItemUserCopyKey];
9292 }
9393 - (id)initWithCoder:(NSCoder *)aDecoder
9494 {
9595 self = [self init];
96- [self setName:[aDecoder decodeObjectForKey:BSLCItemNameKey]];
97- [self setRegularExpression:[aDecoder decodeObjectForKey:BSLCItemREKey]];
98- [self setTargetApplicationName:[aDecoder decodeObjectForKey:BSLCItemAppNameKey]];
99- [self setOpenInBackground:[aDecoder decodeBoolForKey:BSLCItemOpenBGKey]];
100- [self setUseLocalCopy:[aDecoder decodeBoolForKey:BSLCItemUserCopyKey]];
96+ self.name = [aDecoder decodeObjectForKey:BSLCItemNameKey];
97+ self.regularExpression = [aDecoder decodeObjectForKey:BSLCItemREKey];
98+ self.targetApplicationName = [aDecoder decodeObjectForKey:BSLCItemAppNameKey];
99+ self.openInBackground = [aDecoder decodeBoolForKey:BSLCItemOpenBGKey];
100+ self.useLocalCopy = [aDecoder decodeBoolForKey:BSLCItemUserCopyKey];
101101
102102 return self;
103103 }
@@ -105,7 +105,7 @@ static NSString *const BSLCItemUserCopyKey = @"BSLCItemUserCopyKey";
105105 - (id)description
106106 {
107107 return [NSString stringWithFormat:@"%@<%p> {name = %@, regularExpression = %@, targetApplicationName = %@",
108- NSStringFromClass([self class]), self, name, regularExpression, targetApplicationName];
108+ NSStringFromClass([self class]), self, self.name, self.regularExpression, self.targetApplicationName];
109109 }
110110
111111 @end