Changeset 603 for AE/installer2/src/net/oni2/aeinstaller/backend
- Timestamp:
- Jan 10, 2013, 5:25:51 PM (12 years ago)
- Location:
- AE/installer2/src/net/oni2/aeinstaller/backend
- Files:
-
- 1 deleted
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
AE/installer2/src/net/oni2/aeinstaller/backend/depot/DepotManager.java
r600 r603 87 87 88 88 // Get taxonomy vocabulary 89 listener.cacheUpdateProgress("Updating taxonomy vocabulary", 0, 100); 89 if (listener != null) 90 listener.cacheUpdateProgress("Updating taxonomy vocabulary", 0, 91 100); 90 92 page = 0; 91 93 do { … … 100 102 101 103 // Get taxonomy terms 102 listener.cacheUpdateProgress("Updating taxonomy terms", 0, 100); 104 if (listener != null) 105 listener.cacheUpdateProgress("Updating taxonomy terms", 0, 100); 103 106 page = 0; 104 107 do { … … 113 116 114 117 // Check nodes for new information 115 listener.cacheUpdateProgress("Checking for new/updated nodes", 1, 116 100); 118 if (listener != null) 119 listener.cacheUpdateProgress("Checking for new/updated nodes", 120 1, 100); 117 121 HashSet<Integer> nodesToUpdate = new HashSet<Integer>(); 118 122 page = 0; … … 142 146 143 147 // Check files for new stuff 144 listener.cacheUpdateProgress("Checking for new/updated files", 2, 145 100); 148 if (listener != null) 149 listener.cacheUpdateProgress("Checking for new/updated files", 150 2, 100); 146 151 HashSet<Integer> filesToUpdate = new HashSet<Integer>(); 147 152 page = 0; … … 168 173 // Update nodes with new information 169 174 for (int nid : nodesToUpdate) { 170 listener.cacheUpdateProgress("Updating nodes", step++, total); 175 if (listener != null) 176 listener.cacheUpdateProgress("Updating nodes", step++, 177 total); 171 178 172 179 ja = DrupalJSONQuery.getItem("node", nid, ""); … … 188 195 // Update new files 189 196 for (int fid : filesToUpdate) { 190 listener.cacheUpdateProgress("Updating files", step++, total); 197 if (listener != null) 198 listener.cacheUpdateProgress("Updating files", step++, 199 total); 191 200 192 201 ja = DrupalJSONQuery.getItem("file", fid, "&file_contents=0"); -
AE/installer2/src/net/oni2/aeinstaller/backend/depot/model/NodeMod.java
r600 r603 148 148 return Integer.parseInt(fields.get("package_number")); 149 149 } 150 151 /** 152 * @return Is this mod a tool? 153 */ 154 public boolean isTool() { 155 TaxonomyTerm tt = DepotManager.getInstance().getTaxonomyTerm( 156 DepotConfig.getTaxonomyName_ModType_Tool()); 157 return getTypes().contains(tt); 158 } 150 159 } -
AE/installer2/src/net/oni2/aeinstaller/backend/mods/Mod.java
r602 r603 13 13 import net.oni2.aeinstaller.backend.Settings; 14 14 import net.oni2.aeinstaller.backend.Settings.Platform; 15 import net.oni2.aeinstaller.backend.depot.DepotConfig;16 15 import net.oni2.aeinstaller.backend.depot.DepotManager; 17 16 import net.oni2.aeinstaller.backend.depot.model.NodeMod; … … 56 55 Type t = ModManager.getInstance().getTypeByName(tt.getName()); 57 56 types.add(t); 58 if (! t.getName().equals(DepotConfig.getTaxonomyName_ModType_Tool()))57 if (!nm.isTool()) 59 58 t.addEntry(this); 60 59 } … … 187 186 */ 188 187 public boolean isNewerAvailable() { 189 if ( node != null)190 return node.getUploads().firstElement().getTimestamp() > localTimestamp;188 if (file != null) 189 return file.getTimestamp() > localTimestamp; 191 190 else 192 191 return false; … … 261 260 public int getZipSize() { 262 261 return zipSize; 263 }264 265 /**266 * @return Depot Mod-Node267 */268 public NodeMod getNode() {269 return node;270 262 } 271 263 -
AE/installer2/src/net/oni2/aeinstaller/backend/mods/ModManager.java
r602 r603 10 10 11 11 import net.oni2.aeinstaller.backend.Paths; 12 import net.oni2.aeinstaller.backend.depot.DepotConfig;13 12 import net.oni2.aeinstaller.backend.depot.DepotManager; 14 13 import net.oni2.aeinstaller.backend.depot.model.NodeMod; … … 56 55 } 57 56 58 TaxonomyTerm toolTerm = DepotManager.getInstance().getTaxonomyTerm(59 DepotConfig.getTaxonomyName_ModType_Tool());60 57 for (NodeMod nm : DepotManager.getInstance().getModPackageNodes()) { 61 58 if (nm.getUploads().size() == 1) { 62 59 Mod m = new Mod(nm); 63 if (nm. getTypes().contains(toolTerm))60 if (nm.isTool()) 64 61 tools.put(m.getPackageNumber(), m); 65 62 else -
AE/installer2/src/net/oni2/aeinstaller/backend/oni/Installer.java
r602 r603 272 272 FileUtils.copyFile(keyConfVanilla, keyConfEdition); 273 273 274 // TODO: FileUtils.deleteDirectory(init); 274 FileUtils.deleteDirectory(init); 275 275 276 Date end = new Date(); 276 277 log.println("Initialization ended at " + sdf.format(end)); … … 384 385 } 385 386 } 387 388 /** 389 * Verify that the Edition is within a subfolder to vanilla Oni (..../Oni/Edition/AEInstaller) 390 * @return true if GDF can be found in the parent's parent-path 391 */ 392 public static boolean verifyRunningDirectory() { 393 return Paths.getVanillaGDF().exists() && Paths.getVanillaGDF().isDirectory(); 394 } 386 395 }
Note:
See TracChangeset
for help on using the changeset viewer.