app: Calculate number of creators in about dialog

This commit is contained in:
Martin Nordholts 2011-01-27 18:35:01 +01:00
parent d6fbe5acd4
commit 285a42eef3
2 changed files with 13 additions and 5 deletions

View File

@ -41,6 +41,10 @@
#include "gimp-intl.h" #include "gimp-intl.h"
/* The first authors are the creators, don't shuffle them */
#define START_INDEX (G_N_ELEMENTS (creators) - 1 /*NULL*/)
typedef struct typedef struct
{ {
GtkWidget *dialog; GtkWidget *dialog;
@ -242,9 +246,6 @@ about_dialog_reshuffle (GimpAboutDialog *dialog)
for (i = 0; i < dialog->n_authors; i++) for (i = 0; i < dialog->n_authors; i++)
dialog->shuffle[i] = i; dialog->shuffle[i] = i;
/* here we rely on the authors array having Peter and Spencer first */
#define START_INDEX 2
for (i = START_INDEX; i < dialog->n_authors; i++) for (i = START_INDEX; i < dialog->n_authors; i++)
{ {
gint j = g_rand_int_range (gr, START_INDEX, dialog->n_authors); gint j = g_rand_int_range (gr, START_INDEX, dialog->n_authors);
@ -259,8 +260,6 @@ about_dialog_reshuffle (GimpAboutDialog *dialog)
} }
} }
#undef START_INDEX
g_rand_free (gr); g_rand_free (gr);
} }

View File

@ -17,6 +17,15 @@
<xsl:text> <xsl:text>
/* NOTE: This file is auto-generated from authors.xml, do not edit it. */ /* NOTE: This file is auto-generated from authors.xml, do not edit it. */
static const gchar * const creators[] =
{
</xsl:text>
<xsl:apply-templates select="dc:creator" />
<xsl:text> NULL
};
</xsl:text>
<xsl:text>
static const gchar * const authors[] = static const gchar * const authors[] =
{ {
</xsl:text> </xsl:text>