summaryrefslogtreecommitdiff
path: root/widget
diff options
context:
space:
mode:
Diffstat (limited to 'widget')
-rw-r--r--widget/inc/Widget.h1
-rw-r--r--widget/src/Widget.cpp33
2 files changed, 12 insertions, 22 deletions
diff --git a/widget/inc/Widget.h b/widget/inc/Widget.h
index 249f919..a4375a0 100644
--- a/widget/inc/Widget.h
+++ b/widget/inc/Widget.h
@@ -65,7 +65,6 @@ private:
WidgetItems m_Items;
bool m_EditMode;
- bool m_IsPicking;
size_t m_MaxCount;
int m_WidgetHeight;
diff --git a/widget/src/Widget.cpp b/widget/src/Widget.cpp
index 4088981..01b8809 100644
--- a/widget/src/Widget.cpp
+++ b/widget/src/Widget.cpp
@@ -40,7 +40,7 @@ namespace
}
Widget::Widget()
- : m_EditMode(false), m_IsPicking(false), m_MaxCount(0),
+ : m_EditMode(false), m_MaxCount(0),
m_WidgetHeight(0), m_Layout(nullptr), m_Gengrid(nullptr), m_AddButton(nullptr)
{
using namespace std::placeholders;
@@ -182,7 +182,7 @@ void Widget::setAddButton()
if (!m_AddButton) {
m_AddButton = elm_gengrid_item_append(m_Gengrid, getAddButtonItemClass(), this, &Widget::onAddPressed, this);
}
- } else if (m_AddButton) {
+ } else if(m_AddButton) {
elm_object_item_del(m_AddButton);
m_AddButton = nullptr;
}
@@ -195,12 +195,9 @@ void Widget::onAddPressed(void *data, Evas_Object *obj, void *event_info)
elm_gengrid_item_selected_set(widget->m_AddButton, EINA_FALSE);
}
- if (!widget->m_IsPicking) {
- int err = launchContactPick(APP_CONTROL_DATA_SELECTION_MODE_SINGLE, APP_CONTROL_DATA_TYPE_PHONE_OR_EMAIL,
- &Widget::onPickReply, data, false);
- WPRET_M(err != APP_CONTROL_ERROR_NONE, "launchContactPick() failed(%d)", err);
- widget->m_IsPicking = true;
- }
+ int err = launchContactPick(APP_CONTROL_DATA_SELECTION_MODE_SINGLE, APP_CONTROL_DATA_TYPE_PHONE_OR_EMAIL,
+ &Widget::onPickReply, data, false);
+ WPWARN(err != APP_CONTROL_ERROR_NONE, "launchContactPick() failed(%d)", err);
}
void Widget::onEditPressed(void *data, Evas_Object *obj, void *event_info)
@@ -217,31 +214,25 @@ void Widget::onEditPressed(void *data, Evas_Object *obj, void *event_info)
void Widget::onPickReply(app_control_h request, app_control_h reply, app_control_result_e result, void *data)
{
Widget *widget = (Widget*) data;
- widget->m_IsPicking = false;
-
char *type = nullptr;
- char **ids = nullptr;
- int count = 0;
+ char *value = nullptr;
- int err = app_control_get_extra_data_array(reply, APP_CONTROL_DATA_SELECTED, &ids, &count);
+ int err = app_control_get_extra_data(reply, APP_CONTROL_DATA_SELECTED, &value);
WPRET_M(err != APP_CONTROL_ERROR_NONE, "app_control_get_extra_data() failed(%d)", err);
app_control_get_extra_data(reply, APP_CONTROL_DATA_TYPE, &type);
- if (type && ids && ids[0]) {
+ if (type) {
if (strcmp(type, APP_CONTROL_DATA_TYPE_PHONE_CALL) == 0) {
- widget->onAddItem(WidgetItemCall, atoi(ids[0]));
+ widget->onAddItem(WidgetItemCall, atoi(value));
} else if (strcmp(type, APP_CONTROL_DATA_TYPE_PHONE_MESSAGE) == 0) {
- widget->onAddItem(WidgetItemMessage, atoi(ids[0]));
+ widget->onAddItem(WidgetItemMessage, atoi(value));
} else if (strcmp(type, APP_CONTROL_DATA_TYPE_EMAIL) == 0) {
- widget->onAddItem(WidgetItemEmail, atoi(ids[0]));
+ widget->onAddItem(WidgetItemEmail, atoi(value));
}
}
free(type);
- for (int i = 0; i < count; ++i) {
- free(ids[i]);
- }
- free(ids);
+ free(value);
}
void Widget::onItemUpdate(WidgetItem &item)