Changeset 3054 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2010-02-27T15:55:13+01:00 (15 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/MainApplication.java
r2876 r3054 175 175 176 176 monitor.subTask(tr("Installing updated plugins")); 177 PluginHandler.installDownloadedPlugins( );177 PluginHandler.installDownloadedPlugins(true); 178 178 monitor.worked(1); 179 179 -
trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginPreferencesModel.java
r2990 r3054 289 289 for (PluginInformation pi : plugins) { 290 290 File downloadedPluginFile = new File(pluginDir, pi.name + ".jar.new"); 291 if (! downloadedPluginFile.exists() && downloadedPluginFile.canRead()) {291 if (!(downloadedPluginFile.exists() && downloadedPluginFile.canRead())) { 292 292 continue; 293 293 } -
trunk/src/org/openstreetmap/josm/plugins/PluginDownloadTask.java
r2990 r3054 173 173 downloaded.add(d); 174 174 } 175 PluginHandler.installDownloadedPlugins(false); 175 176 } 176 177 -
trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java
r2990 r3054 714 714 * 715 715 */ 716 public static void installDownloadedPlugins( ) {716 public static void installDownloadedPlugins(boolean dowarn) { 717 717 File pluginDir = Main.pref.getPluginsDirectory(); 718 718 if (! pluginDir.exists() || ! pluginDir.isDirectory() || ! pluginDir.canWrite()) … … 729 729 String pluginName = updatedPlugin.getName().substring(0, updatedPlugin.getName().length() - 8); 730 730 if (plugin.exists()) { 731 if (!plugin.delete() ) {731 if (!plugin.delete() && !dowarn) { 732 732 System.err.println(tr("Warning: failed to delete outdated plugin ''{0}''.", plugin.toString())); 733 733 System.err.println(tr("Warning: failed to install already downloaded plugin ''{0}''. Skipping installation. JOSM is still going to load the old plugin version.", pluginName)); … … 735 735 } 736 736 } 737 if (!updatedPlugin.renameTo(plugin) ) {737 if (!updatedPlugin.renameTo(plugin) && !dowarn) { 738 738 System.err.println(tr("Warning: failed to install plugin ''{0}'' from temporary download file ''{1}''. Renaming failed.", plugin.toString(), updatedPlugin.toString())); 739 739 System.err.println(tr("Warning: failed to install already downloaded plugin ''{0}''. Skipping installation. JOSM is still going to load the old plugin version.", pluginName));
Note:
See TracChangeset
for help on using the changeset viewer.