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

Apache apache at crosswire.org
Thu Sep 9 17:52:10 MST 2004


Author: 
Date: 2004-09-09 17:52:10 -0700 (Thu, 09 Sep 2004)
New Revision: 18

Modified:
   trunk/app/src/org/crosswire/flashcards/EditorFrame.java
   trunk/app/src/org/crosswire/flashcards/MainFrame.java
Log:
attempt to understand/fix loading lesson files from a directory.
Commiting now to work more from home.


Modified: trunk/app/src/org/crosswire/flashcards/EditorFrame.java
===================================================================
--- trunk/app/src/org/crosswire/flashcards/EditorFrame.java	2004-09-09 22:20:42 UTC (rev 17)
+++ trunk/app/src/org/crosswire/flashcards/EditorFrame.java	2004-09-10 00:52:10 UTC (rev 18)
@@ -88,8 +88,8 @@
     static class WordEntry {
         public WordEntry(String word) { this.word = word; }
         public WordEntry(String word, String answers) { this(word); this.answers = answers; }
-        public String word;
-        public String answers;
+        public String word = "";
+        public String answers = "";
         public String toString() {
             return word;
         }

Modified: trunk/app/src/org/crosswire/flashcards/MainFrame.java
===================================================================
--- trunk/app/src/org/crosswire/flashcards/MainFrame.java	2004-09-09 22:20:42 UTC (rev 17)
+++ trunk/app/src/org/crosswire/flashcards/MainFrame.java	2004-09-10 00:52:10 UTC (rev 18)
@@ -235,7 +235,7 @@
       {
           connection = lessonsURL.openConnection();
       }
-      catch (IOException e1)
+      catch (Exception e1)
       {
           assert false;
       }
@@ -276,7 +276,10 @@
   
   private void loadHomeLessons(String directoryPath)
   {
+    try {
       List files = new ArrayList();
+      File childFile = new File(directoryPath);
+      directoryPath = childFile.getParent();
       getFileListing(new File(directoryPath), files);
       Collections.sort(files);
       Iterator iter = files.iterator();
@@ -297,6 +300,10 @@
           String filePath = file.getPath().replace('\\', '/');
           lessonSet.add(filePath);
       }
+    }
+    catch (Exception e) {
+	// that's fine.  We just failed to load local files.
+    }
   }
 
   private void loadWidgets()



More information about the sword-cvs mailing list