aboutsummaryrefslogtreecommitdiffstats
path: root/legacy/elementary/src/bin/test_gengrid.c
diff options
context:
space:
mode:
authorRafael Fonseca <rfonseca@profusion.mobi>2010-10-11 01:46:14 +0000
committerRafael Fonseca <rfonseca@profusion.mobi>2010-10-11 01:46:14 +0000
commitc2b339a5674680ac41560980da6b926e50caf1ce (patch)
tree23402c26bf5cbf0507300950aa36b92ba3069bbb /legacy/elementary/src/bin/test_gengrid.c
parentbugs-- (diff)
downloadefl-c2b339a5674680ac41560980da6b926e50caf1ce.tar.gz
Make Gengrid 2 test work with recent gengrid modifications.
Before changing gengrid internal to use inlist, passing a NULL item to insert_before and insert_after functions would make them behave as prepend and append respectively but now one would just get a SEGV. So test for a selected item before doing anything ;) SVN revision: 53251
Diffstat (limited to 'legacy/elementary/src/bin/test_gengrid.c')
-rw-r--r--legacy/elementary/src/bin/test_gengrid.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/legacy/elementary/src/bin/test_gengrid.c b/legacy/elementary/src/bin/test_gengrid.c
index 5bd1ed8f98..d6a9117094 100644
--- a/legacy/elementary/src/bin/test_gengrid.c
+++ b/legacy/elementary/src/bin/test_gengrid.c
@@ -196,6 +196,8 @@ _before_bt_clicked(void *data, Evas_Object *obj, void *event_info)
char buf[PATH_MAX];
sel = elm_gengrid_selected_item_get(grid);
+ if (!sel)
+ return;
snprintf(buf, sizeof(buf), "%s/images/%s", PACKAGE_DATA_DIR, img[rand() % 9]);
ti = malloc(sizeof(*ti));
ti->mode = 0;
@@ -213,6 +215,8 @@ _after_bt_clicked(void *data, Evas_Object *obj, void *event_info)
char buf[PATH_MAX];
sel = elm_gengrid_selected_item_get(grid);
+ if (!sel)
+ return;
snprintf(buf, sizeof(buf), "%s/images/%s", PACKAGE_DATA_DIR, img[rand() % 9]);
ti = malloc(sizeof(*ti));
ti->mode = 0;