Revision: 14898
          http://gate.svn.sourceforge.net/gate/?rev=14898&view=rev
Author:   markagreenwood
Date:     2012-01-06 07:36:34 +0000 (Fri, 06 Jan 2012)
Log Message:
-----------
now supports multiple sites offering the same plugin by only listing the newest 
version

Modified Paths:
--------------
    gate/trunk/src/gate/gui/creole/manager/PluginUpdateManager.java

Modified: gate/trunk/src/gate/gui/creole/manager/PluginUpdateManager.java
===================================================================
--- gate/trunk/src/gate/gui/creole/manager/PluginUpdateManager.java     
2012-01-06 02:19:27 UTC (rev 14897)
+++ gate/trunk/src/gate/gui/creole/manager/PluginUpdateManager.java     
2012-01-06 07:36:34 UTC (rev 14898)
@@ -198,7 +198,22 @@
         // invalid for some reason
         for(RemoteUpdateSite rus : updateSites) {
           if(rus.enabled && (rus.valid == null || rus.valid)) {
-            availableModel.data.addAll(rus.getCreolePlugins());
+            
+            for(CreolePlugin p : rus.getCreolePlugins()) {
+              int index = availableModel.data.indexOf(p);
+              if(index == -1) {
+                availableModel.data.add(p);
+              } else {
+                // if the plugin was already known then replace it if this
+                // instance is a newer version
+                CreolePlugin pp = availableModel.data.get(index);
+
+                if(VersionComparator.compareVersions(p.version, pp.version) > 
0) {
+                  availableModel.data.remove(pp);
+                  availableModel.data.add(p);
+                }
+              }
+            }
           }
         }
 

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual 
desktops for less than the cost of PCs and save 60% on VDI infrastructure 
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
_______________________________________________
GATE-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gate-cvs

Reply via email to