[sword-svn] r2621 - trunk/bindings/objc/src

mdbergmann at crosswire.org mdbergmann at crosswire.org
Tue Apr 19 10:14:09 MST 2011


Author: mdbergmann
Date: 2011-04-19 10:14:09 -0700 (Tue, 19 Apr 2011)
New Revision: 2621

Modified:
   trunk/bindings/objc/src/SwordInstallSource.h
   trunk/bindings/objc/src/SwordInstallSource.mm
Log:
Added listModulesForType: method.

Modified: trunk/bindings/objc/src/SwordInstallSource.h
===================================================================
--- trunk/bindings/objc/src/SwordInstallSource.h	2011-04-17 16:15:08 UTC (rev 2620)
+++ trunk/bindings/objc/src/SwordInstallSource.h	2011-04-19 17:14:09 UTC (rev 2621)
@@ -7,6 +7,7 @@
 //
 
 #import <Foundation/Foundation.h>
+#import <SwordModule.h>
 
 #ifdef __cplusplus
 #include <swmgr.h>
@@ -58,11 +59,12 @@
                  usingManager:(SwordManager *)swManager 
         withInstallController:(SwordInstallSourceController *)sim;
 
-/**
- List of available InstallSources
- */
+/** List of available InstallSources */
 - (NSArray *)listModules;
 
+/** List of modules for given type */
+- (NSArray *)listModulesForType:(ModuleType)aType;
+
 /** list module types */
 - (NSArray *)listModuleTypes;
 

Modified: trunk/bindings/objc/src/SwordInstallSource.mm
===================================================================
--- trunk/bindings/objc/src/SwordInstallSource.mm	2011-04-17 16:15:08 UTC (rev 2620)
+++ trunk/bindings/objc/src/SwordInstallSource.mm	2011-04-19 17:14:09 UTC (rev 2621)
@@ -140,10 +140,8 @@
 
 /** list all modules of this source */
 - (NSArray *)listModules {
-    NSArray *ret = nil;
+    NSArray *ret = [NSArray array];
     
-    DLog(@"");    
-    
     SwordManager *sm = [self swordManager];
     if(sm) {
         ret = [sm listModules];
@@ -154,6 +152,19 @@
     return ret;
 }
 
+- (NSArray *)listModulesForType:(ModuleType)aType {
+    NSArray *ret = [NSArray array];
+
+    SwordManager *sm = [self swordManager];
+    if(sm) {
+        ret = [sm modulesForType:aType];
+    } else {
+        ALog(@"Have nil SwordManager");        
+    }    
+    
+    return ret;
+}
+
 /** list module types */
 - (NSArray *)listModuleTypes {
     NSArray *ret = nil;




More information about the sword-cvs mailing list