Changeset 5666


Ignore:
Timestamp:
2003-10-17T04:43:00+13:00 (21 years ago)
Author:
jmt12
Message:

Rewrote code to avoid AppendLineOnlyFileDocument constructor being called twice (which I suppose was only really a problem on existing logs)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gli/src/org/greenstone/gatherer/gui/OptionsPane.java

    r5593 r5666  
    475475    private class FileEntry {
    476476
    477     private Date date;
    478     private long last_modified;
    479     private String display;
    480     private String filename;
    481     private String filepath;
    482 
    483     public FileEntry(String filename, String filepath) {
    484         this.date = null;
    485         this.display = null;
    486         this.filename = filename;
    487         this.filepath = filepath;
    488         this.last_modified = 0L;
    489     }
     477       private AppendLineOnlyFileDocument current_document;
     478       private Date date;
     479       private long last_modified;
     480       private String display;
     481       private String filename;
     482       private String filepath;
     483       
     484       public FileEntry(String filename, String filepath) {
     485      this.date = null;
     486      this.display = null;
     487      this.filename = filename;
     488      this.filepath = filepath;
     489      this.last_modified = 0L;
     490       }
    490491
    491492    /** returns 0 if the dates are the same, -ve number if the current FileEntry is earlier than the fe FileEntry ...*/
     
    513514    }
    514515
    515     public AppendLineOnlyFileDocument getDocument() {
    516         return new AppendLineOnlyFileDocument(filepath);
     516       public AppendLineOnlyFileDocument getDocument() {
     517      if(current_document == null) {
     518         current_document = new AppendLineOnlyFileDocument(filepath);
     519      }
     520      return current_document;
    517521    }
    518522
     
    537541        }
    538542        catch(Exception error) {
    539             error.printStackTrace();
     543           System.err.println("Log '" + filepath + "' not found!");
     544            Gatherer.printStackTrace(error);
    540545        }
    541546        switch (success) {
Note: See TracChangeset for help on using the changeset viewer.