show only newer plugins as updates

This commit is contained in:
Sebastian Sdorra
2011-01-28 17:41:11 +01:00
parent 0d2c393821
commit 985c9ba03d
6 changed files with 118 additions and 27 deletions

View File

@@ -418,10 +418,14 @@ public class DefaultPluginManager implements PluginManager
{
state = PluginState.INSTALLED;
}
else
else if (isNewer(available, installed))
{
state = PluginState.UPDATE_AVAILABLE;
}
else
{
state = PluginState.NEWER_VERSION_INSTALLED;
}
break;
}
@@ -513,6 +517,29 @@ public class DefaultPluginManager implements PluginManager
return center;
}
/**
* Method description
*
*
* @param available
* @param installed
*
* @return
*/
private boolean isNewer(PluginInformation available,
PluginInformation installed)
{
boolean result = false;
PluginVersion version = PluginVersion.createVersion(installed.getVersion());
if (version != null)
{
result = version.isNewer(available.getVersion());
}
return result;
}
/**
* Method description
*