diff options
| author | SND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2014-09-27 19:35:23 +0000 |
|---|---|---|
| committer | SND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2014-09-27 19:35:23 +0000 |
| commit | 5932a2148fd466cab7e50c5798347e73a6a81fd1 (patch) | |
| tree | c30b9adab90e8627cac06a3a14944c449a80cf1a /macosx/Source | |
| parent | 637f97d9dbdb2451d80f091a650aee1e071df846 (diff) | |
| download | pcsxr-5932a2148fd466cab7e50c5798347e73a6a81fd1.tar.gz | |
OS X: Make PluginList comply with the NSFastEnumeration protocol.
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@91643 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'macosx/Source')
| -rw-r--r-- | macosx/Source/PcsxrPlugin.m | 2 | ||||
| -rw-r--r-- | macosx/Source/PluginList.h | 6 | ||||
| -rw-r--r-- | macosx/Source/PluginList.m | 16 |
3 files changed, 21 insertions, 3 deletions
diff --git a/macosx/Source/PcsxrPlugin.m b/macosx/Source/PcsxrPlugin.m index 1472b634..3b43cbb8 100644 --- a/macosx/Source/PcsxrPlugin.m +++ b/macosx/Source/PcsxrPlugin.m @@ -369,7 +369,7 @@ - (NSUInteger)hash { - return [path hash]; + return [fullPlugPath hash]; } - (NSString *)description diff --git a/macosx/Source/PluginList.h b/macosx/Source/PluginList.h index 0ffdf38e..2383cf32 100644 --- a/macosx/Source/PluginList.h +++ b/macosx/Source/PluginList.h @@ -10,8 +10,9 @@ #import "PcsxrPlugin.h" //extern NSMutableArray *plugins; +@class PcsxrPlugin; -@interface PluginList : NSObject +@interface PluginList : NSObject <NSFastEnumeration> + (PluginList *)list; @@ -25,4 +26,7 @@ - (void)disableNetPlug; - (void)enableNetPlug; +- (PcsxrPlugin*)objectAtIndexedSubscript:(NSInteger)index; +- (NSInteger)count; + @end diff --git a/macosx/Source/PluginList.m b/macosx/Source/PluginList.m index cbe4cb95..fe5870bb 100644 --- a/macosx/Source/PluginList.m +++ b/macosx/Source/PluginList.m @@ -312,7 +312,21 @@ const static int typeList[] = {PSE_LT_GPU, PSE_LT_SPU, PSE_LT_CDR, PSE_LT_PAD, P dst++; } } - +} + +- (NSInteger)count; +{ + return self.pluginList.count; +} + +- (NSUInteger)countByEnumeratingWithState:(NSFastEnumerationState *)state objects:(__unsafe_unretained id [])buffer count:(NSUInteger)len +{ + return [self.pluginList countByEnumeratingWithState:state objects:buffer count:len]; +} + +- (PcsxrPlugin*)objectAtIndexedSubscript:(NSInteger)index +{ + return self.pluginList[index]; } @end |
