summaryrefslogtreecommitdiff
path: root/lib-phone
diff options
context:
space:
mode:
Diffstat (limited to 'lib-phone')
-rw-r--r--lib-phone/ph-dialer/src/PhDialerSpeeddialPopup.cpp14
-rw-r--r--lib-phone/ph-speeddial/inc/PhSpeedDialItem.h3
-rw-r--r--lib-phone/ph-speeddial/src/PhSpeedDialItem.cpp36
3 files changed, 12 insertions, 41 deletions
diff --git a/lib-phone/ph-dialer/src/PhDialerSpeeddialPopup.cpp b/lib-phone/ph-dialer/src/PhDialerSpeeddialPopup.cpp
index 83fbd52..66f012e 100644
--- a/lib-phone/ph-dialer/src/PhDialerSpeeddialPopup.cpp
+++ b/lib-phone/ph-dialer/src/PhDialerSpeeddialPopup.cpp
@@ -57,12 +57,11 @@ void PhDialerSpeeddialPopup::onPickResult(app_control_h request, app_control_h r
{
PhDialerSpeeddialPopup *popup = (PhDialerSpeeddialPopup*) data;
- char **numberIds = 0;
- int count = 0;
- int err = app_control_get_extra_data_array(reply, APP_CONTROL_DATA_SELECTED, &numberIds, &count);
+ char *value = 0;
+ int err = app_control_get_extra_data(reply, APP_CONTROL_DATA_SELECTED, &value);
WPWARN(err != APP_CONTROL_ERROR_NONE, "app_control_get_extra_data() failed(0x%x)", err);
- if (numberIds && numberIds[0]) {
- int numberId = atoi(numberIds[0]);
+ if (value) {
+ int numberId = atoi(value);
if (numberId > 0) {
if (PhCommon::addSpeedDialNumber(popup->m_SpeedNumber, numberId)) {
notification_status_message_post(T_("IDS_KPD_TPOP_SPEED_DIAL_NUMBER_ASSIGNED"));
@@ -70,12 +69,9 @@ void PhDialerSpeeddialPopup::onPickResult(app_control_h request, app_control_h r
notification_status_message_post(T_("IDS_PB_POP_ALREADY_EXISTS_LC"));
}
}
- }
- for (int i = 0; i < count; ++i) {
- free(numberIds[i]);
+ free(value);
}
- free(numberIds);
popup->destroy();
}
diff --git a/lib-phone/ph-speeddial/inc/PhSpeedDialItem.h b/lib-phone/ph-speeddial/inc/PhSpeedDialItem.h
index b1bb217..9a773f9 100644
--- a/lib-phone/ph-speeddial/inc/PhSpeedDialItem.h
+++ b/lib-phone/ph-speeddial/inc/PhSpeedDialItem.h
@@ -30,7 +30,6 @@ public:
* @param[in] number Speed dial dialer number (1-9)
*/
PhSpeedDialItem(int number);
- ~PhSpeedDialItem();
/**
* @brief Set speed dial item data.
@@ -46,7 +45,6 @@ private:
void setEmptyLayout(Evas_Object *layout);
void setLayoutData(Evas_Object *layout, contacts_record_h record);
void fetchData();
- void closeChooser();
static void onPickResult(app_control_h request, app_control_h reply,
app_control_result_e result, void *data);
@@ -54,7 +52,6 @@ private:
static void onDeletePressed(void *data, Evas_Object *obj, void *event_info);
int m_Number;
- app_control_h m_Chooser;
};
#endif /* _PH_SPEED_DIAL_ITEM_H_ */
diff --git a/lib-phone/ph-speeddial/src/PhSpeedDialItem.cpp b/lib-phone/ph-speeddial/src/PhSpeedDialItem.cpp
index f8e6f93..da6338c 100644
--- a/lib-phone/ph-speeddial/src/PhSpeedDialItem.cpp
+++ b/lib-phone/ph-speeddial/src/PhSpeedDialItem.cpp
@@ -35,15 +35,10 @@ namespace
}
PhSpeedDialItem::PhSpeedDialItem(int number)
- : m_Number(number), m_Chooser(nullptr)
+ : m_Number(number)
{
}
-PhSpeedDialItem::~PhSpeedDialItem()
-{
- closeChooser();
-}
-
void PhSpeedDialItem::setData(contacts_record_h record)
{
if (record) {
@@ -115,27 +110,18 @@ void PhSpeedDialItem::fetchData()
contacts_record_destroy(record, true);
}
-void PhSpeedDialItem::closeChooser()
-{
- if (m_Chooser) {
- app_control_send_terminate_request(m_Chooser);
- app_control_destroy(m_Chooser);
- m_Chooser = nullptr;
- }
-}
-
void PhSpeedDialItem::onPickResult(app_control_h request, app_control_h reply,
app_control_result_e result, void *data)
{
PhSpeedDialItem *item = (PhSpeedDialItem*) data;
- char **numberIds = nullptr;
- int count = 0;
- int err = app_control_get_extra_data_array(reply, APP_CONTROL_DATA_SELECTED, &numberIds, &count);
+ char *value = nullptr;
+ 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);
- if (numberIds && numberIds[0]) {
- int numberId = atoi(numberIds[0]);
+ if (value) {
+ int numberId = atoi(value);
+ free(value);
if (PhCommon::addSpeedDialNumber(item->m_Number, numberId)) {
item->fetchData();
@@ -143,20 +129,12 @@ void PhSpeedDialItem::onPickResult(app_control_h request, app_control_h reply,
notification_status_message_post(PAT_("IDS_PB_POP_ALREADY_EXISTS_LC"));
}
}
-
- for (int i = 0; i < count; ++i) {
- free(numberIds[i]);
- }
- free(numberIds);
}
void PhSpeedDialItem::onItemPressed(void *data, Evas_Object *obj, void *event_info)
{
- PhSpeedDialItem *item = (PhSpeedDialItem*) data;
- item->closeChooser();
-
int err = launchContactPick(APP_CONTROL_DATA_SELECTION_MODE_SINGLE, APP_CONTROL_DATA_TYPE_PHONE,
- &PhSpeedDialItem::onPickResult, data, true, &item->m_Chooser);
+ &PhSpeedDialItem::onPickResult, data);
WPWARN(err != APP_CONTROL_ERROR_NONE, "launchContactPick() failed(%d)", err);
}