summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorOlliver Schinagl <o.schinagl@ultimaker.com>2015-06-19 14:09:12 (GMT)
committerOlliver Schinagl <o.schinagl@ultimaker.com>2015-06-19 14:09:12 (GMT)
commit2ba50536071623872344a44b4246b88af4a8583a (patch)
tree512a429daa16f25c1f86246d1ca916a7ec5819fd /src
parent770d58557ace288848733a33f6b3ef5ec18fc6f3 (diff)
downloadeulogium-2ba50536071623872344a44b4246b88af4a8583a.zip
eulogium-2ba50536071623872344a44b4246b88af4a8583a.tar.gz
eulogium-2ba50536071623872344a44b4246b88af4a8583a.tar.bz2
hack around filelist return segfaulting.
Signed-off-by: Olliver Schinagl <o.schinagl@ultimaker.com>
Diffstat (limited to 'src')
-rw-r--r--src/eulogium_item_list.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/eulogium_item_list.c b/src/eulogium_item_list.c
index 98cb461..2cf62a1 100644
--- a/src/eulogium_item_list.c
+++ b/src/eulogium_item_list.c
@@ -43,7 +43,7 @@ static Evas_Object *_item_new(Evas_Object *parent, Evas_Object *icon, char const
{
Evas_Object *it;
const char *cb = "changed";
- struct list_item dummy = {.type = LIST_ITEM_BUTTON};
+ struct list_item dummy = {.type = LIST_ITEM_BUTTON, ._widget = NULL};
if (!item) /* If no button type is passed (file-list for ex.) use the default 'button' entry */
item = &dummy;
@@ -57,6 +57,16 @@ static Evas_Object *_item_new(Evas_Object *parent, Evas_Object *icon, char const
it = elm_check_add(parent);
elm_check_state_pointer_set(it, &item->state);
/* elm_object_style_set(it, "list"); */
+ /* XXX FIXME: this is a hack. PRINT -> Return -> Segfault.
+ * When we return to the from the file list in the PRINT menu, we segfault.
+ * Technically we don't want to store the pointer to the widget for anything
+ * but checkboxes and radio buttons, but a generic callback at the bottom for
+ * all cases was nicer. Since we don't have radio buttons yet we can leave
+ * this here for now.
+ */
+ evas_object_event_callback_add(it, EVAS_CALLBACK_DEL, _item_destroy_cb, &item->_widget);
+ if (evas_alloc_error() != EVAS_ALLOC_ERROR_NONE)
+ EINA_LOG_CRIT("Callback registering failed! Problems ensured!\n");
break;
case LIST_ITEM_BUTTON:
cb = "clicked";
@@ -78,9 +88,6 @@ static Evas_Object *_item_new(Evas_Object *parent, Evas_Object *icon, char const
evas_object_size_hint_align_set(it, EVAS_HINT_FILL, 0);
evas_object_show(it);
item->_widget = it;
- evas_object_event_callback_add(it, EVAS_CALLBACK_DEL, _item_destroy_cb, &item->_widget);
- if (evas_alloc_error() != EVAS_ALLOC_ERROR_NONE)
- EINA_LOG_CRIT("Callback registering failed! Problems ensured!\n");
return it;
}