「プロジェクト終了」 BathyScapheのプレビューアプラグインを複数使用出来るようにするプラグイン
リビジョン | dbd7973de092e30900a5e92cf3967c9cda58bd47 (tree) |
---|---|
日時 | 2012-07-14 20:56:52 |
作者 | masakih <masakih@user...> |
コミッター | masakih |
[Mod] プロパティ用インスタンス変数に_を付けた
@@ -10,8 +10,5 @@ | ||
10 | 10 | |
11 | 11 | |
12 | 12 | @interface PSPPreviewerTableView : NSTableView |
13 | -{ | |
14 | - | |
15 | -} | |
16 | 13 | |
17 | 14 | @end |
@@ -11,13 +11,13 @@ | ||
11 | 11 | |
12 | 12 | @interface PSPreviewerItem : NSObject <NSCopying, NSCoding> |
13 | 13 | { |
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; | |
21 | 21 | } |
22 | 22 | |
23 | 23 | - (id)initWithIdentifier:(NSString *)identifier; |
@@ -20,10 +20,10 @@ static NSMutableDictionary *previewerInfo = nil; | ||
20 | 20 | |
21 | 21 | @implementation PSPreviewerItem |
22 | 22 | |
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; | |
27 | 27 | |
28 | 28 | + (void)initialize |
29 | 29 | { |
@@ -38,7 +38,7 @@ static NSMutableDictionary *previewerInfo = nil; | ||
38 | 38 | - (id)initWithIdentifier:(NSString *)inIdentifier |
39 | 39 | { |
40 | 40 | if(self = [super init]) { |
41 | - identifier = [inIdentifier copy]; | |
41 | + _identifier = [inIdentifier copy]; | |
42 | 42 | } |
43 | 43 | |
44 | 44 | return self; |
@@ -46,26 +46,26 @@ static NSMutableDictionary *previewerInfo = nil; | ||
46 | 46 | |
47 | 47 | - (void)dealloc |
48 | 48 | { |
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]; | |
53 | 53 | |
54 | - [identifier release]; | |
54 | + [_identifier release]; | |
55 | 55 | |
56 | 56 | [super dealloc]; |
57 | 57 | } |
58 | 58 | |
59 | 59 | - (void)setPreviewer:(id)newPreviewer |
60 | 60 | { |
61 | - if(previewer == newPreviewer) return; | |
61 | + if(_previewer == newPreviewer) return; | |
62 | 62 | |
63 | - [previewer autorelease]; | |
63 | + [_previewer autorelease]; | |
64 | 64 | |
65 | 65 | if(!newPreviewer) return; |
66 | 66 | |
67 | - previewer = [newPreviewer retain]; | |
68 | - [previewerInfo setObject:previewer forKey:identifier]; | |
67 | + _previewer = [newPreviewer retain]; | |
68 | + [previewerInfo setObject:_previewer forKey:_identifier]; | |
69 | 69 | } |
70 | 70 | |
71 | 71 | - (BOOL)isEqual:(id)object |
@@ -88,25 +88,25 @@ static NSMutableDictionary *previewerInfo = nil; | ||
88 | 88 | |
89 | 89 | - (id)copyWithZone:(NSZone *)zone |
90 | 90 | { |
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; | |
98 | 98 | |
99 | 99 | return result; |
100 | 100 | } |
101 | 101 | |
102 | 102 | - (void)encodeWithCoder:(NSCoder *)aCoder |
103 | 103 | { |
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]; | |
110 | 110 | } |
111 | 111 | - (id)initWithCoder:(NSCoder *)aDecoder |
112 | 112 | { |
@@ -117,8 +117,7 @@ static NSMutableDictionary *previewerInfo = nil; | ||
117 | 117 | self.tryCheck = [aDecoder decodeBoolForKey:PSPITryCheckKey]; |
118 | 118 | self.displayInMenu = [aDecoder decodeBoolForKey:PSPIDisplayInMenuKey]; |
119 | 119 | |
120 | - id p = [previewerInfo objectForKey:identifier]; | |
121 | - if(p) self.previewer = p; | |
120 | + self.previewer = [previewerInfo objectForKey:_identifier]; | |
122 | 121 | |
123 | 122 | return self; |
124 | 123 | } |
@@ -13,7 +13,7 @@ | ||
13 | 13 | |
14 | 14 | @interface PSPreviewerItems : NSObject |
15 | 15 | { |
16 | - NSMutableArray *previewerItems; | |
16 | + NSMutableArray *_previewerItems; | |
17 | 17 | } |
18 | 18 | |
19 | 19 | - (void)setPreference:(id)pref; |
@@ -30,14 +30,14 @@ static NSString *noarmalImagePreviewerName = @"ImagePreviewer"; | ||
30 | 30 | - (id)init |
31 | 31 | { |
32 | 32 | [super init]; |
33 | - previewerItems = [[NSMutableArray alloc] init]; | |
33 | + _previewerItems = [[NSMutableArray alloc] init]; | |
34 | 34 | |
35 | 35 | return self; |
36 | 36 | } |
37 | 37 | |
38 | 38 | - (NSArray *)previewerItems |
39 | 39 | { |
40 | - return previewerItems; | |
40 | + return _previewerItems; | |
41 | 41 | } |
42 | 42 | - (void)setPreference:(id)pref |
43 | 43 | { |
@@ -56,13 +56,13 @@ static NSString *noarmalImagePreviewerName = @"ImagePreviewer"; | ||
56 | 56 | |
57 | 57 | // リストアされ且つロード済のプラグインを追加 |
58 | 58 | for(PSPreviewerItem *item in retoredItems) { |
59 | - if([previewerItems containsObject:item]) { | |
59 | + if([_previewerItems containsObject:item]) { | |
60 | 60 | [newItems addObject:item]; |
61 | 61 | } |
62 | 62 | } |
63 | 63 | |
64 | 64 | // リストアされていないがロード済のプラグインを追加 |
65 | - for(PSPreviewerItem *item in previewerItems) { | |
65 | + for(PSPreviewerItem *item in _previewerItems) { | |
66 | 66 | if(![newItems containsObject:item]) { |
67 | 67 | [newItems addObject:item]; |
68 | 68 | } else { |
@@ -74,13 +74,13 @@ static NSString *noarmalImagePreviewerName = @"ImagePreviewer"; | ||
74 | 74 | } |
75 | 75 | } |
76 | 76 | |
77 | - [previewerItems autorelease]; | |
78 | - previewerItems = [newItems retain]; | |
77 | + [_previewerItems autorelease]; | |
78 | + _previewerItems = [newItems retain]; | |
79 | 79 | } |
80 | 80 | |
81 | 81 | - (void)awakePreviewers |
82 | 82 | { |
83 | - for(PSPreviewerItem *item in previewerItems) { | |
83 | + for(PSPreviewerItem *item in _previewerItems) { | |
84 | 84 | id previewer = [item previewer]; |
85 | 85 | if([previewer respondsToSelector:@selector(awakeByPreviewerSelector:)]) { |
86 | 86 | [previewer performSelector:@selector(awakeByPreviewerSelector:) |
@@ -116,8 +116,8 @@ static NSString *noarmalImagePreviewerName = @"ImagePreviewer"; | ||
116 | 116 | v = [pluginBundle objectForInfoDictionaryKey:@"BSPreviewerDisplayName"]; |
117 | 117 | item.displayName = v ?: name; |
118 | 118 | |
119 | - if(![previewerItems containsObject:item]) { | |
120 | - [previewerItems addObject:item]; | |
119 | + if(![_previewerItems containsObject:item]) { | |
120 | + [_previewerItems addObject:item]; | |
121 | 121 | } |
122 | 122 | } |
123 | 123 | - (void)loadDefaultPreviewer |
@@ -15,8 +15,8 @@ | ||
15 | 15 | |
16 | 16 | @interface PreviewerSelector : NSObject <BSImagePreviewerProtocol, BSLinkPreviewing> |
17 | 17 | { |
18 | - AppDefaults *preferences; | |
19 | - PSPreviewerItems *items; | |
18 | + AppDefaults *_preferences; | |
19 | + PSPreviewerItems *_items; | |
20 | 20 | } |
21 | 21 | |
22 | 22 | + (id)sharedInstance; |
@@ -163,7 +163,7 @@ final: | ||
163 | 163 | |
164 | 164 | - (NSArray *)loadedPlugInsInfo |
165 | 165 | { |
166 | - return [items previewerItems]; | |
166 | + return [_items previewerItems]; | |
167 | 167 | } |
168 | 168 | |
169 | 169 | - (void)savePlugInsInfo |
@@ -287,7 +287,7 @@ final: | ||
287 | 287 | { |
288 | 288 | self = [self init]; |
289 | 289 | |
290 | - items = [[PSPreviewerItems alloc] init]; | |
290 | + _items = [[PSPreviewerItems alloc] init]; | |
291 | 291 | |
292 | 292 | [self setPreferences:prefs]; |
293 | 293 |
@@ -296,15 +296,15 @@ final: | ||
296 | 296 | // Accessor |
297 | 297 | - (AppDefaults *)preferences |
298 | 298 | { |
299 | - return preferences; | |
299 | + return _preferences; | |
300 | 300 | } |
301 | 301 | - (void)setPreferences:(AppDefaults *)aPreferences |
302 | 302 | { |
303 | - id temp = preferences; | |
304 | - preferences = [aPreferences retain]; | |
303 | + id temp = _preferences; | |
304 | + _preferences = [aPreferences retain]; | |
305 | 305 | [temp release]; |
306 | 306 | |
307 | - [items setPreference:preferences]; | |
307 | + [_items setPreference:_preferences]; | |
308 | 308 | } |
309 | 309 | // Action |
310 | 310 | - (BOOL)showImageWithURL:(NSURL *)imageURL |