Changeset 6168 for trunk/gli/src/org/greenstone/gatherer/gui
- Timestamp:
- 2003-12-08T17:02:31+13:00 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/gui/NewCollectionDetailsPrompt.java
r6159 r6168 45 45 extends ModalDialog { 46 46 47 static public boolean titleClashes(String title ) {47 static public boolean titleClashes(String title, File current_config_file) { 48 48 File collection_directory = new File(Utility.getCollectionDir(Gatherer.config.gsdl_path)); 49 49 File children[] = collection_directory.listFiles(); 50 50 for(int i = 0; children != null && i < children.length; i++) { 51 51 if(children[i].isDirectory()) { 52 BasicCollectionConfiguration other_collection = new BasicCollectionConfiguration(new File(children[i], Utility.CONFIG_DIR)); 53 if(other_collection.getName().equalsIgnoreCase(title)) { 54 return true; 52 File config_file = new File(children[i], Utility.CONFIG_DIR); 53 if(current_config_file == null || !config_file.equals(current_config_file)) { 54 BasicCollectionConfiguration other_collection = new BasicCollectionConfiguration(config_file); 55 if(other_collection.getName().equalsIgnoreCase(title)) { 56 return true; 57 } 58 other_collection = null; 55 59 } 56 other_collection= null;60 config_file = null; 57 61 } 58 62 } … … 407 411 // We must ensure that the collection title is unique. This is a pain in the nether regions as we are forced to load the collect.cfg of each other collection in turn looking for a conflicting title 408 412 else { 409 if(titleClashes(title_final )) {413 if(titleClashes(title_final, null)) { 410 414 if(JOptionPane.showConfirmDialog(Gatherer.g_man, Dictionary.get("NewCollectionPrompt.Title_Clash"), Dictionary.get("General.Warning"), JOptionPane.OK_CANCEL_OPTION) == JOptionPane.NO_OPTION) { 411 415 title.setForeground(Gatherer.config.getColor("coloring.error_foreground", false));
Note:
See TracChangeset
for help on using the changeset viewer.