More properties for the contribution filter

This commit is contained in:
pesckal
2011-08-12 23:17:12 +00:00
parent 9ad79a8cfa
commit a30dbbb5a1

View File

@@ -256,19 +256,34 @@ public class ContributionListing {
public boolean isProperty(String property) {
return property.startsWith("updat") || property.startsWith("upgrad")
|| property.startsWith("instal") && !property.startsWith("installabl");
|| property.startsWith("instal") && !property.startsWith("installabl")
|| property.equals("tool") || property.startsWith("lib")
|| property.equals("mode") || property.equals("compilation");
}
/** Returns true if the contribution fits the given property, false otherwise.
* If the property is invalid, returns false. */
public boolean hasProperty(Contribution contrib, String property) {
// update, updates, updatable
// update, updates, updatable, upgrade
if (property.startsWith("updat") || property.startsWith("upgrad")) {
return hasUpdates(contrib);
}
if (property.startsWith("instal") && !property.startsWith("installabl")) {
return contrib.isInstalled();
}
if (property.equals("tool")) {
return contrib.getType() == Contribution.Type.TOOL;
}
if (property.startsWith("lib")) {
return contrib.getType() == Contribution.Type.LIBRARY
|| contrib.getType() == Contribution.Type.LIBRARY_COMPILATION;
}
if (property.equals("mode")) {
return contrib.getType() == Contribution.Type.MODE;
}
if (property.equals("compilation")) {
return contrib.getType() == Contribution.Type.LIBRARY_COMPILATION;
}
return false;
}