Changeset 3054 in josm


Ignore:
Timestamp:
Feb 27, 2010 3:55:13 PM (3 years ago)
Author:
stoecker
Message:

don't keep .jar.new for linux, this is only necessary for windows system

Location:
trunk/src/org/openstreetmap/josm
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/MainApplication.java

    r2876 r3054  
    175175 
    176176        monitor.subTask(tr("Installing updated plugins")); 
    177         PluginHandler.installDownloadedPlugins(); 
     177        PluginHandler.installDownloadedPlugins(true); 
    178178        monitor.worked(1); 
    179179 
  • trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginPreferencesModel.java

    r2990 r3054  
    289289        for (PluginInformation pi : plugins) { 
    290290            File downloadedPluginFile = new File(pluginDir, pi.name + ".jar.new"); 
    291             if (! downloadedPluginFile.exists() && downloadedPluginFile.canRead()) { 
     291            if (!(downloadedPluginFile.exists() && downloadedPluginFile.canRead())) { 
    292292                continue; 
    293293            } 
  • trunk/src/org/openstreetmap/josm/plugins/PluginDownloadTask.java

    r2990 r3054  
    173173            downloaded.add(d); 
    174174        } 
     175        PluginHandler.installDownloadedPlugins(false); 
    175176    } 
    176177 
  • trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java

    r2990 r3054  
    714714     *  
    715715     */ 
    716     public static void installDownloadedPlugins() { 
     716    public static void installDownloadedPlugins(boolean dowarn) { 
    717717        File pluginDir = Main.pref.getPluginsDirectory(); 
    718718        if (! pluginDir.exists() || ! pluginDir.isDirectory() || ! pluginDir.canWrite()) 
     
    729729            String pluginName = updatedPlugin.getName().substring(0, updatedPlugin.getName().length() - 8); 
    730730            if (plugin.exists()) { 
    731                 if (!plugin.delete()) { 
     731                if (!plugin.delete() && !dowarn) { 
    732732                    System.err.println(tr("Warning: failed to delete outdated plugin ''{0}''.", plugin.toString())); 
    733733                    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)); 
     
    735735                } 
    736736            } 
    737             if (!updatedPlugin.renameTo(plugin)) { 
     737            if (!updatedPlugin.renameTo(plugin) && !dowarn) { 
    738738                System.err.println(tr("Warning: failed to install plugin ''{0}'' from temporary download file ''{1}''. Renaming failed.", plugin.toString(), updatedPlugin.toString())); 
    739739                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.