Changeset 1490
- Timestamp:
- 12/04/19 17:10:37 (4 years ago)
- Location:
- trunk/src/org/expeditee/gui
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/gui/FrameUtils.java
r1462 r1490 876 876 File filePath = Paths.get(FrameIO.PARENT_FOLDER).resolve(dirName).toFile(); 877 877 boolean locationExists = filePath.exists() && filePath.isDirectory(); 878 if (isSpecialCase || locationExists) {878 //if (isSpecialCase || locationExists) { 879 879 if (dirName.endsWith(File.separator)) { 880 880 dirsToAdd.add(dirName); … … 882 882 dirsToAdd.add(dirName + File.separator); 883 883 } 884 }884 //} 885 885 } 886 886 -
trunk/src/org/expeditee/gui/management/ResourceManager.java
r1471 r1490 42 42 } else { 43 43 List<String> canditateDirectoriesForResource = frames.getDirectories(); 44 for (String path: canditateDirectoriesForResource) { 45 loaded = FrameIO.LoadKnownPath(path, frameName); 46 if (loaded != null) { 47 break; 44 for (String directoryStr: canditateDirectoriesForResource) { 45 File directory = new File(directoryStr); 46 if (directory.exists()) { 47 loaded = FrameIO.LoadKnownPath(directoryStr, frameName); 48 if (loaded != null) { 49 break; 50 } 48 51 } 49 52 } … … 112 115 // users settings frame. 113 116 File resourceFile = null; 114 for (String dir: canditateDirectoriesForResource) { 115 resourceFile = new File(dir + path); 116 if (resourceFile.exists() && !resourceFile.isDirectory()) { 117 break; 117 for (String dirStr: canditateDirectoriesForResource) { 118 File dir = new File(dirStr); 119 if (dir.exists()) { 120 File checkResourceFile = new File(dirStr + path); 121 if (checkResourceFile.exists() && !checkResourceFile.isDirectory()) { 122 resourceFile = checkResourceFile; 123 break; 124 } 118 125 } 119 126 } … … 128 135 // These are of the format "/packageA/packageB/filename". For 129 136 // example: "/org/expeditee/gui.management/ResourceManager.java" 130 if (resourceFile == null || !resourceFile.exists() || resourceFile.isDirectory()) {137 if (resourceFile == null/* || !resourceFile.exists() || resourceFile.isDirectory()*/) { 131 138 // Prepare for case a. 132 139 resourceFile = new File(path); … … 177 184 List<String> directories = audio.getDirectories(parentFrame); 178 185 directories.add(FrameIO.PARENT_FOLDER); 179 for (String directory: directories) { 180 Path pathToFile = Paths.get(directory).resolve(localFileName); 181 File file = pathToFile.toFile(); 182 if (file.exists() && !file.isDirectory()) { 183 return file; 184 } 186 for (String directoryStr: directories) { 187 File directory = new File(directoryStr); 188 if (directory.exists()) { 189 Path directoryPath = Paths.get(directoryStr); 190 Path pathToFile = directoryPath.resolve(localFileName); 191 File file = pathToFile.toFile(); 192 if (file.exists() && !file.isDirectory()) { 193 return file; 194 } 195 } 185 196 } 186 197 … … 260 271 } 261 272 262 private void refresh(String context) { 263 273 private void refresh(String context) { 264 274 List<String> unresolved = source.getAbsoluteDirs(); 265 275 directories = resolve(unresolved, context);
Note:
See TracChangeset
for help on using the changeset viewer.