Changeset 2542 in josm for trunk/src


Ignore:
Timestamp:
2009-11-28T23:56:56+01:00 (12 years ago)
Author:
stoecker
Message:

cleanup plugin information a bit

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

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/Preferences.java

    r2512 r2542  
    616616    }
    617617
     618    synchronized public String getCollectionAsString(final String key) {
     619        String s = get(key);
     620        if(s != null && s.length() != 0)
     621            s = s.replaceAll("\u001e",",");
     622        return s;
     623    }
     624
    618625    synchronized public Collection<String> getCollection(String key, Collection<String> def) {
    619626        String s = get(key);
  • trunk/src/org/openstreetmap/josm/plugins/PluginDownloader.java

    r2372 r2542  
    9595    }
    9696
    97     private final static String[] pluginSites = {"http://josm.openstreetmap.de/plugin"};
     97    private final static String[] pluginSites = {"http://josm.openstreetmap.de/plugin%<?plugins=>"};
    9898
    9999    public static Collection<String> getSites() {
     
    109109            /* TODO: remove old site files (everything except .jar) */
    110110            try {
     111                /* replace %<x> with empty string or x=plugins (separated with comma) */
     112                String pl = Main.pref.getCollectionAsString("plugins");
     113                if(pl != null && pl.length() != 0)
     114                    site = site.replaceAll("%<(.*)>", "$1"+pl);
     115                else
     116                    site = site.replaceAll("%<(.*)>", "");
    111117                BufferedReader r = new BufferedReader(new InputStreamReader(new URL(site).openStream(), "utf-8"));
    112118                new File(Main.pref.getPreferencesDir()+"plugins").mkdir();
  • trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java

    r2389 r2542  
    352352    {
    353353        String text = "";
    354         String pl = Main.pref.get("plugins");
     354        String pl = Main.pref.getCollectionAsString("plugins");
    355355        if(pl != null && pl.length() != 0) {
    356356            text += "Plugins: "+pl+"\n";
Note: See TracChangeset for help on using the changeset viewer.