Permalink
Browse files

more bug fixes. project quote should work even when there's no build.

  • Loading branch information...
kohsuke
kohsuke committed Oct 9, 2010
1 parent 874c6f4 commit 7e84f22136a7ccf2433df5efadaf74ef6b04853f
@@ -65,7 +65,7 @@ protected Persona() {
public abstract Quote generateQuote(AbstractBuild<?,?> build);
/**
- * Generates a random quote for the top page.
+ * Generates a random quote for the project top page.
*
* @see AbstractQuoteImpl
*/
@@ -23,7 +23,7 @@ public String getQuote() {
@Override
public Image getImage() {
QuoteImpl q = getLastQuote();
- return q!=null ? q.getImage() : null;
+ return q!=null ? q.getImage() : persona.getDefaultImage();
}
private QuoteImpl getLastQuote() {
@@ -56,6 +56,8 @@ protected SimplePersona(String id, List<String> quotes) {
*/
public abstract Image getImage(AbstractBuild<?, ?> build);
+ public abstract Image getDefaultImage();
+
@Override
public Quote generateQuote(AbstractBuild<?, ?> build) {
return new QuoteImpl(build,this, getRandomQuoteText());
@@ -154,6 +154,11 @@ public Image getImage(AbstractBuild<?,?> build) {
return new Image(icon,other);
}
+ @Override
+ public Image getDefaultImage() {
+ return new Image(icon,success);
+ }
+
public String getDisplayName() {
return displayName;
}

0 comments on commit 7e84f22

Please sign in to comment.