[gimp] app: Calculate number of creators in about dialog
- From: Martin Nordholts <martinn src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: Calculate number of creators in about dialog
- Date: Thu, 27 Jan 2011 17:50:34 +0000 (UTC)
commit 285a42eef305679ad3619ddf14d44ee81f641d4a
Author: Martin Nordholts <martinn src gnome org>
Date: Thu Jan 27 18:35:01 2011 +0100
app: Calculate number of creators in about dialog
app/dialogs/about-dialog.c | 9 ++++-----
app/dialogs/authors.xsl | 9 +++++++++
2 files changed, 13 insertions(+), 5 deletions(-)
---
diff --git a/app/dialogs/about-dialog.c b/app/dialogs/about-dialog.c
index e384c15..bda27cd 100644
--- a/app/dialogs/about-dialog.c
+++ b/app/dialogs/about-dialog.c
@@ -41,6 +41,10 @@
#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
{
GtkWidget *dialog;
@@ -242,9 +246,6 @@ about_dialog_reshuffle (GimpAboutDialog *dialog)
for (i = 0; i < dialog->n_authors; 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++)
{
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);
}
diff --git a/app/dialogs/authors.xsl b/app/dialogs/authors.xsl
index 4c6bf41..d06317c 100644
--- a/app/dialogs/authors.xsl
+++ b/app/dialogs/authors.xsl
@@ -17,6 +17,15 @@
<xsl:text>
/* 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[] =
{
</xsl:text>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]