[sword-cvs] r25 - trunk/app/src/org/crosswire/flashcards

Apache apache at crosswire.org
Wed Sep 15 13:28:23 MST 2004


Author: 
Date: 2004-09-15 13:28:23 -0700 (Wed, 15 Sep 2004)
New Revision: 25

Modified:
   trunk/app/src/org/crosswire/flashcards/LessonManager.java
   trunk/app/src/org/crosswire/flashcards/SetupPane.java
Log:
fix a bug that caused the wrong lessons to be shown

Modified: trunk/app/src/org/crosswire/flashcards/LessonManager.java
===================================================================
--- trunk/app/src/org/crosswire/flashcards/LessonManager.java	2004-09-15 13:46:53 UTC (rev 24)
+++ trunk/app/src/org/crosswire/flashcards/LessonManager.java	2004-09-15 20:28:23 UTC (rev 25)
@@ -176,8 +176,14 @@
                 File file = files[i];
                 if (file.isDirectory())
                 {
+                    // convert the path to one that is relative to the home and has forward slashes
+                    String lessonPath = file.getPath();
+                    // If it uses \ as a path separator then replace it w/ /
+                    lessonPath = lessonPath.replace('\\', '/');
+                    int offset = lessonPath.indexOf(LESSON_ROOT);
+                    lessonPath = lessonPath.substring(offset, lessonPath.length());
                     // let the description be just the directory name and not the path
-                    add(new LessonSet(file.getPath(), file.getName()));
+                    add(new LessonSet(lessonPath, file.getName()));
                 }
             }
         }

Modified: trunk/app/src/org/crosswire/flashcards/SetupPane.java
===================================================================
--- trunk/app/src/org/crosswire/flashcards/SetupPane.java	2004-09-15 13:46:53 UTC (rev 24)
+++ trunk/app/src/org/crosswire/flashcards/SetupPane.java	2004-09-15 20:28:23 UTC (rev 25)
@@ -135,7 +135,7 @@
          */
         public Object next()
         {
-            return model.get(currentIndex++);
+            return model.get(selectedIndexes[currentIndex++]);
         }
 
         private int[] selectedIndexes;



More information about the sword-cvs mailing list