Changeset 24905

Show
Ignore:
Timestamp:
15.12.2011 21:52:46 (8 years ago)
Author:
ak19
Message:

Now that quotes are necessary around collecthome in gsdlsite.cfg if there are spaces in the collecthome path, this needs to propagate into GLI: a dialog pops up on GLI exit if collecthome has changed. But collecthome has not changed if all that's been added is quotes around the collecthome variable as read from gsdlsite.cfg.

Location:
main/trunk/gli/src/org/greenstone/gatherer
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/gli/src/org/greenstone/gatherer/Gatherer.java

    r24904 r24905  
    925925    public static void collectDirectoryHasChanged( 
    926926    String oldCollectPath, String newCollectPath, final Component container)  
    927     {    
     927    {        
    928928        if(oldCollectPath.equals(newCollectPath)) { 
    929929            return; // nothing to be done 
     
    976976            String collectDir = Gatherer.getCollectDirectoryPath(); 
    977977            //collectDir = "\"" + collectDir.substring(0, collectDir.length()-1) + "\""; // remove file separator at end     
    978             collectDir = collectDir.substring(0, collectDir.length()-1); // remove file separator at end     
    979             Utility.updatePropertyConfigFile(getGsdlSiteConfigFile(), "collecthome", "\""+collectDir+"\""); 
     978            collectDir = collectDir.substring(0, collectDir.length()-1); // remove file separator at end 
     979            if(collectDir != null) { 
     980                collectDir = "\""+collectDir+"\""; 
     981            } 
     982            Utility.updatePropertyConfigFile(getGsdlSiteConfigFile(), "collecthome", collectDir); 
    980983            // if gsdlsite.cfg does not exist (if using server.exe for instance), the above method will just return 
    981984             
  • main/trunk/gli/src/org/greenstone/gatherer/gui/GUIManager.java

    r24904 r24905  
    543543        boolean showSettingsDlg = true; 
    544544        // if collectdir was changed during GLI session (to something different from what's in gsdlsite), need to ask what to store 
    545         if(gliColDir.equals(Gatherer.gsdlsite_collecthome+File.separator)) {     
     545        String gsdlsiteColdir = Gatherer.gsdlsite_collecthome.replace("\"", ""); 
     546        if(gliColDir.equals(gsdlsiteColdir+File.separator)) {    
    546547            showSettingsDlg = false; 
    547         } else if(Gatherer.gsdlsite_collecthome.equals("") // both set to default coldir 
     548        } else if(gsdlsiteColdir.equals("") // both set to default coldir 
    548549                && gliColDir.equals(defaultColDir+File.separator)) { 
    549550            showSettingsDlg = false; 
     
    674675                if(serverColDir != null && defaultColDir.equals(serverColDir)) {                     
    675676                    serverColDir = null; 
     677                }                
     678                 
     679                if(serverColDir != null) { 
     680                    serverColDir = serverColDir.replace("\"",""); 
     681                    serverColDir = "\""+serverColDir+"\""; 
    676682                } 
    677683                                 
    678684                Gatherer.gsdlsite_collecthome = Utility.updatePropertyConfigFile( 
    679                     Gatherer.getGsdlSiteConfigFile(), "collecthome", "\""+serverColDir+"\"");    
     685                    Gatherer.getGsdlSiteConfigFile(), "collecthome", serverColDir);  
    680686                 
    681687                colHomeDialog.dispose();