[recipes] Make sure we don't skip the wrong cuisine
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [recipes] Make sure we don't skip the wrong cuisine
- Date: Sun, 12 Feb 2017 16:32:59 +0000 (UTC)
commit c7e69c78d5afe340a2fae04de8ce43102ce3e4ce
Author: Matthias Clasen <mclasen redhat com>
Date: Sun Feb 12 11:10:53 2017 -0500
Make sure we don't skip the wrong cuisine
I was trying to be needlessly efficient here, and ended
up skipping the american cuisine in most cases. Just compare
the strings.
https://bugzilla.gnome.org/show_bug.cgi?id=778529
src/gr-cuisines-page.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/gr-cuisines-page.c b/src/gr-cuisines-page.c
index d184052..602c361 100644
--- a/src/gr-cuisines-page.c
+++ b/src/gr-cuisines-page.c
@@ -103,7 +103,6 @@ populate_cuisines (GrCuisinesPage *page)
int length;
int i, j;
GrRecipeStore *store;
- int pos = 0;
int tiles;
container_remove_all (GTK_CONTAINER (page->top_box));
@@ -124,6 +123,7 @@ populate_cuisines (GrCuisinesPage *page)
length = g_strv_length (cuisines);
if (!page->featured && length > 0) {
+ int pos;
pos = g_random_int_range (0, length);
page->featured = g_strdup (cuisines[pos]);
}
@@ -135,7 +135,7 @@ populate_cuisines (GrCuisinesPage *page)
tiles = 0;
for (i = 0; i < length; i++) {
- if (i == pos)
+ if (strcmp (page->featured, cuisines[i]) == 0)
continue;
tile = gr_cuisine_tile_new (cuisines[i], FALSE);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]