masakih

PreviewerSelector (プロジェクト終了)

  • R/O
  • HTTP
  • SSH
  • HTTPS

コミット

よく使われているワード(クリックで追加)

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

「プロジェクト終了」 BathyScapheのプレビューアプラグインを複数使用出来るようにするプラグイン


コミットメタ情報

リビジョンdbd7973de092e30900a5e92cf3967c9cda58bd47 (tree)
日時2012-07-14 20:56:52
作者masakih <masakih@user...>
コミッターmasakih

ログメッセージ

[Mod] プロパティ用インスタンス変数に_を付けた

変更サマリ

差分

--- a/PSPPreviewerTableView.h
+++ b/PSPPreviewerTableView.h
@@ -10,8 +10,5 @@
1010
1111
1212 @interface PSPPreviewerTableView : NSTableView
13-{
14-
15-}
1613
1714 @end
--- a/PSPreviewerItem.h
+++ b/PSPreviewerItem.h
@@ -11,13 +11,13 @@
1111
1212 @interface PSPreviewerItem : NSObject <NSCopying, NSCoding>
1313 {
14- id previewer; // コピーしない。 codingしない。
15- NSString *identifier;
16- NSString *displayName;
17- NSString *path;
18- NSString *version;
19- BOOL tryCheck;
20- BOOL displayInMenu;
14+ id _previewer; // コピーしない。 codingしない。
15+ NSString *_identifier;
16+ NSString *_displayName;
17+ NSString *_path;
18+ NSString *_version;
19+ BOOL _tryCheck;
20+ BOOL _displayInMenu;
2121 }
2222
2323 - (id)initWithIdentifier:(NSString *)identifier;
--- a/PSPreviewerItem.m
+++ b/PSPreviewerItem.m
@@ -20,10 +20,10 @@ static NSMutableDictionary *previewerInfo = nil;
2020
2121 @implementation PSPreviewerItem
2222
23-@synthesize identifier;
24-@synthesize previewer;
25-@synthesize displayName, path, version;
26-@synthesize tryCheck, displayInMenu;
23+@synthesize identifier = _identifier;
24+@synthesize previewer = _previewer;
25+@synthesize displayName = _displayName, path = _path, version = _version;
26+@synthesize tryCheck = _tryCheck, displayInMenu = _displayInMenu;
2727
2828 + (void)initialize
2929 {
@@ -38,7 +38,7 @@ static NSMutableDictionary *previewerInfo = nil;
3838 - (id)initWithIdentifier:(NSString *)inIdentifier
3939 {
4040 if(self = [super init]) {
41- identifier = [inIdentifier copy];
41+ _identifier = [inIdentifier copy];
4242 }
4343
4444 return self;
@@ -46,26 +46,26 @@ static NSMutableDictionary *previewerInfo = nil;
4646
4747 - (void)dealloc
4848 {
49- self.previewer = nil;
50- self.displayName = nil;
51- self.path = nil;
52- self.version = nil;
49+ [_previewer release];
50+ [_displayName release];
51+ [_path release];
52+ [_version release];
5353
54- [identifier release];
54+ [_identifier release];
5555
5656 [super dealloc];
5757 }
5858
5959 - (void)setPreviewer:(id)newPreviewer
6060 {
61- if(previewer == newPreviewer) return;
61+ if(_previewer == newPreviewer) return;
6262
63- [previewer autorelease];
63+ [_previewer autorelease];
6464
6565 if(!newPreviewer) return;
6666
67- previewer = [newPreviewer retain];
68- [previewerInfo setObject:previewer forKey:identifier];
67+ _previewer = [newPreviewer retain];
68+ [previewerInfo setObject:_previewer forKey:_identifier];
6969 }
7070
7171 - (BOOL)isEqual:(id)object
@@ -88,25 +88,25 @@ static NSMutableDictionary *previewerInfo = nil;
8888
8989 - (id)copyWithZone:(NSZone *)zone
9090 {
91- PSPreviewerItem *result = [[[self class] allocWithZone:zone] initWithIdentifier:identifier];
92- result.previewer = previewer;
93- result.displayName = displayName;
94- result.version = version;
95- result.path = path;
96- result.tryCheck = tryCheck;
97- result.displayInMenu = displayInMenu;
91+ PSPreviewerItem *result = [[[self class] allocWithZone:zone] initWithIdentifier:_identifier];
92+ result.previewer = _previewer;
93+ result.displayName = _displayName;
94+ result.version = _version;
95+ result.path = _path;
96+ result.tryCheck = _tryCheck;
97+ result.displayInMenu = _displayInMenu;
9898
9999 return result;
100100 }
101101
102102 - (void)encodeWithCoder:(NSCoder *)aCoder
103103 {
104- [aCoder encodeObject:identifier forKey:PSPIIdentifierKey];
105- [aCoder encodeObject:displayName forKey:PSIDisplayNameKey];
106- [aCoder encodeObject:path forKey:PSIPathKey];
107- [aCoder encodeObject:version forKey:PSIVersionKey];
108- [aCoder encodeBool:tryCheck forKey:PSPITryCheckKey];
109- [aCoder encodeBool:displayInMenu forKey:PSPIDisplayInMenuKey];
104+ [aCoder encodeObject:_identifier forKey:PSPIIdentifierKey];
105+ [aCoder encodeObject:_displayName forKey:PSIDisplayNameKey];
106+ [aCoder encodeObject:_path forKey:PSIPathKey];
107+ [aCoder encodeObject:_version forKey:PSIVersionKey];
108+ [aCoder encodeBool:_tryCheck forKey:PSPITryCheckKey];
109+ [aCoder encodeBool:_displayInMenu forKey:PSPIDisplayInMenuKey];
110110 }
111111 - (id)initWithCoder:(NSCoder *)aDecoder
112112 {
@@ -117,8 +117,7 @@ static NSMutableDictionary *previewerInfo = nil;
117117 self.tryCheck = [aDecoder decodeBoolForKey:PSPITryCheckKey];
118118 self.displayInMenu = [aDecoder decodeBoolForKey:PSPIDisplayInMenuKey];
119119
120- id p = [previewerInfo objectForKey:identifier];
121- if(p) self.previewer = p;
120+ self.previewer = [previewerInfo objectForKey:_identifier];
122121
123122 return self;
124123 }
--- a/PSPreviewerItems.h
+++ b/PSPreviewerItems.h
@@ -13,7 +13,7 @@
1313
1414 @interface PSPreviewerItems : NSObject
1515 {
16- NSMutableArray *previewerItems;
16+ NSMutableArray *_previewerItems;
1717 }
1818
1919 - (void)setPreference:(id)pref;
--- a/PSPreviewerItems.m
+++ b/PSPreviewerItems.m
@@ -30,14 +30,14 @@ static NSString *noarmalImagePreviewerName = @"ImagePreviewer";
3030 - (id)init
3131 {
3232 [super init];
33- previewerItems = [[NSMutableArray alloc] init];
33+ _previewerItems = [[NSMutableArray alloc] init];
3434
3535 return self;
3636 }
3737
3838 - (NSArray *)previewerItems
3939 {
40- return previewerItems;
40+ return _previewerItems;
4141 }
4242 - (void)setPreference:(id)pref
4343 {
@@ -56,13 +56,13 @@ static NSString *noarmalImagePreviewerName = @"ImagePreviewer";
5656
5757 // リストアされ且つロード済のプラグインを追加
5858 for(PSPreviewerItem *item in retoredItems) {
59- if([previewerItems containsObject:item]) {
59+ if([_previewerItems containsObject:item]) {
6060 [newItems addObject:item];
6161 }
6262 }
6363
6464 // リストアされていないがロード済のプラグインを追加
65- for(PSPreviewerItem *item in previewerItems) {
65+ for(PSPreviewerItem *item in _previewerItems) {
6666 if(![newItems containsObject:item]) {
6767 [newItems addObject:item];
6868 } else {
@@ -74,13 +74,13 @@ static NSString *noarmalImagePreviewerName = @"ImagePreviewer";
7474 }
7575 }
7676
77- [previewerItems autorelease];
78- previewerItems = [newItems retain];
77+ [_previewerItems autorelease];
78+ _previewerItems = [newItems retain];
7979 }
8080
8181 - (void)awakePreviewers
8282 {
83- for(PSPreviewerItem *item in previewerItems) {
83+ for(PSPreviewerItem *item in _previewerItems) {
8484 id previewer = [item previewer];
8585 if([previewer respondsToSelector:@selector(awakeByPreviewerSelector:)]) {
8686 [previewer performSelector:@selector(awakeByPreviewerSelector:)
@@ -116,8 +116,8 @@ static NSString *noarmalImagePreviewerName = @"ImagePreviewer";
116116 v = [pluginBundle objectForInfoDictionaryKey:@"BSPreviewerDisplayName"];
117117 item.displayName = v ?: name;
118118
119- if(![previewerItems containsObject:item]) {
120- [previewerItems addObject:item];
119+ if(![_previewerItems containsObject:item]) {
120+ [_previewerItems addObject:item];
121121 }
122122 }
123123 - (void)loadDefaultPreviewer
--- a/PreviewerSelector.h
+++ b/PreviewerSelector.h
@@ -15,8 +15,8 @@
1515
1616 @interface PreviewerSelector : NSObject <BSImagePreviewerProtocol, BSLinkPreviewing>
1717 {
18- AppDefaults *preferences;
19- PSPreviewerItems *items;
18+ AppDefaults *_preferences;
19+ PSPreviewerItems *_items;
2020 }
2121
2222 + (id)sharedInstance;
--- a/PreviewerSelector.m
+++ b/PreviewerSelector.m
@@ -163,7 +163,7 @@ final:
163163
164164 - (NSArray *)loadedPlugInsInfo
165165 {
166- return [items previewerItems];
166+ return [_items previewerItems];
167167 }
168168
169169 - (void)savePlugInsInfo
@@ -287,7 +287,7 @@ final:
287287 {
288288 self = [self init];
289289
290- items = [[PSPreviewerItems alloc] init];
290+ _items = [[PSPreviewerItems alloc] init];
291291
292292 [self setPreferences:prefs];
293293
@@ -296,15 +296,15 @@ final:
296296 // Accessor
297297 - (AppDefaults *)preferences
298298 {
299- return preferences;
299+ return _preferences;
300300 }
301301 - (void)setPreferences:(AppDefaults *)aPreferences
302302 {
303- id temp = preferences;
304- preferences = [aPreferences retain];
303+ id temp = _preferences;
304+ _preferences = [aPreferences retain];
305305 [temp release];
306306
307- [items setPreference:preferences];
307+ [_items setPreference:_preferences];
308308 }
309309 // Action
310310 - (BOOL)showImageWithURL:(NSURL *)imageURL